Uh oh!
There was an error while loading. Please reload this page.
gh-149534: Fix unification of defaultdict and frozendict with | - #149539
Conversation
Uh oh!
There was an error while loading. Please reload this page.
sobolevn
commented
May 9, 2026
@JelleZijlstra you were right, there's a big behavior difference here. >>>fromcollectionsimportOrderedDict>>>dict() |OrderedDict()
OrderedDict()
>>>frozendict() |OrderedDict()
frozendict()Since Lines 10531 to 10539 in 354ef33 While it is called for I am not sure that this is a bug, though. It works as expected,, if you know all the little details. But, it might be unexpected for people who just want to swap @vstinner, what do you think? |
JelleZijlstra
commented
May 9, 2026
I don't have a strong opinion on what the right behavior is, but let's make sure that OrderedDict and defaultdict behave consistently at least. |
sobolevn
commented
May 9, 2026
@JelleZijlstra they do :) >>>fromcollectionsimportOrderedDict, defaultdict>>>frozendict() |OrderedDict()
frozendict()
>>>frozendict() |defaultdict()
frozendict() |
vstinner
commented
May 21, 2026
@serhiy-storchaka wrote a similar fix for |
Uh oh!
There was an error while loading. Please reload this page.
sobolevn
commented
Jun 1, 2026
Thanks for the feedback. Done! Please, re-review my changes :) |
Uh oh!
There was an error while loading. Please reload this page.
Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.15. |
GH-150709 is a backport of this pull request to the 3.15 branch. |
serhiy-storchaka
commented
Jun 1, 2026
And, like with OrderedDict, |
I have a lot of free time today 😆
defaultdict | frozendictreturnsdict, notdefaultdict#149534