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
The line config.foo = {} has no effect. I understand that this is consistent with .update, where dictionaries are used as the data model for nested keys and the update'd tree is merged into the current one, but setting an attribute feels like it should never be a no-op; it should either set something, or error.
The text was updated successfully, but these errors were encountered:
The fact that config.foo = {'bar': 'quux'} acts like update and performs a merge is not obvious at all from the syntax.
zmbc
changed the title
Confusing behavior when setting a ConfigTree to an empty dictionary
Confusing behavior when setting a ConfigTree to a dictionary
Dec 13, 2023
Not sure if this is a bug per se, or a design issue, but I was very surprised by the output of this:
The line
config.foo = {}
has no effect. I understand that this is consistent with.update
, where dictionaries are used as the data model for nested keys and the update'd tree is merged into the current one, but setting an attribute feels like it should never be a no-op; it should either set something, or error.The text was updated successfully, but these errors were encountered: