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

[feature request] Specify default value to .select #228

Closed
apsdehal opened this issue Apr 22, 2020 · 0 comments · Fixed by #376
Closed

[feature request] Specify default value to .select #228

apsdehal opened this issue Apr 22, 2020 · 0 comments · Fixed by #376
Labels
enhancement New feature or request
Milestone

Comments

@apsdehal
Copy link

Similar to .get, it would be great if .select can support default values.

from omegaconf import OmegaConf
conf = OmegaConf.create({"a": {"b": 1}})
print(conf.select("a.c", 2)) # Possibly return 2; but is conflicted with throw_on_missing as well 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants