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
I was expecting |= operator to work the same as .update method, because that's how Python dicts work, but |= on a TOMLDocument seems to have no effect:
fromtomlkitimportTOMLDocumentd1=TOMLDocument()
d1['a'] = {'b': 'c'}
d2=TOMLDocument()
d2['a'] = {'b': 'Z'}
d1['a'] |=d2['a'] # expected to be the same as d1['a'].update(d2['a']), but it's notassertd1== {'a': {'b': 'Z'}}, d1# AssertionError: {'a': {'b': 'c'}}
Older versions of Fedora still have this bug, and the new way makes much
more sense when we're only setting a single key in the dictionary.
This was originally written like this when the plan was to add
additional items to the `write_config_data` dictionary.
Relates: python-poetry/tomlkit#331
I was expecting
|=
operator to work the same as.update
method, because that's how Python dicts work, but|=
on a TOMLDocument seems to have no effect:Same code using a Python dict:
The text was updated successfully, but these errors were encountered: