Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks done
asafarevich opened this issue Nov 14, 2024 · 1 comment
Open
4 tasks done

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

asafarevich opened this issue Nov 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@asafarevich
Copy link

asafarevich commented Nov 14, 2024

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

  • OmegaConf version: 2.3.0
  • Python version: 3.9.0
  • Operating system:Ubuntu 22.04.4 LTS
  • Please provide a minimal repro
from omegaconf import OmegaConf
print(OmegaConf.create(None) is None) # False
@asafarevich asafarevich added the bug Something isn't working label Nov 14, 2024
@asafarevich
Copy link
Author

asafarevich commented Nov 14, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant