You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently OmegaConf accepts the following string assignment:
@dataclassclassFoo:
x: int=10cfg: Foo=OmegaConf.structured(Foo)
cfg.x="20"# OmegaConf happily converts from string to int, though mypy would complain
Describe the solution you'd like
Deprecate this functionality to increase type safety. More precisely, all assignments that mypy would complain about should raise a deprecation warning (and, later, an error)
Note that this behavior is well documented in 2.0 and the docs will have to reflect this change.
This extends to boolean as well.
Note that merge should still support it.
omry
changed the title
Deprecate assignment of strings to non-string nodes like IntegerNode / FloatNode
Consider deprecating assignment of strings to non-string nodes like IntegerNode / FloatNode
Dec 26, 2020
Is your feature request related to a problem? Please describe.
Currently OmegaConf accepts the following string assignment:
Describe the solution you'd like
Deprecate this functionality to increase type safety. More precisely, all assignments that mypy would complain about should raise a deprecation warning (and, later, an error)
Additional context
This issue was written following the discussion here: https://github.com/omry/omegaconf/pull/445/files#r541981251
The text was updated successfully, but these errors were encountered: