omry / omegaconf

Flexible Python configuration system. The last one you will ever need.
BSD 3-Clause "New" or "Revised" License
1.98k stars 112 forks source link

OmegaConf.create(None) is None != True #1196

Open asafarevich opened 3 hours ago

asafarevich commented 3 hours ago

Describe the bug DictConfig with None as value does not get treated as None side note: OmegaConf.create(None) == None returns True, but itsn't a valid way to solve the problem cause that triggers flake8 and such...

To Reproduce

print(OmegaConf.create(None) is None) # returns False

Expected behavior

print(OmegaConf.create(None) is None) # returns True

Additional context

asafarevich commented 3 hours ago

Current solution that I've found that kinda gets around the issue is

len(OmegaConf.create(None).keys()) == 0 # returns True

but this only handles DictConfig, not ListConfig