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.{is_none, is_interpolation, is_missing, is_optional} #239

Closed
omry opened this issue Apr 27, 2020 · 0 comments
Closed

OmegaConf.{is_none, is_interpolation, is_missing, is_optional} #239

omry opened this issue Apr 27, 2020 · 0 comments

Comments

@omry
Copy link
Owner

omry commented Apr 27, 2020

The following methods can inspect config or a node in a config

# Optional fields can be assigned None
def is_optional(obj: Any, key: Optional[Union[int, str]] = None) -> bool:

# None fields, well - are None. None fields still have a type (int, dict, etc)
def is_none(obj: Any, key: Optional[Union[int, str]] = None) -> bool:

# True if the node is an interpolation
def is_interpolation(node: Node, key: Optional[Union[int, str]] = None) -> bool:

# True if the node is missing ('???').
def is_missing(cfg: BaseContainer, key: Union[int, str]) -> bool:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant