Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
gh-105736: Sync pure python version of OrderedDict with the C version#108098
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
bedevere-bot commentedAug 17, 2023
🤖 New build scheduled with the buildbot fleet by@rhettinger for commit4f04b7e 🤖 If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
This reverts commit4758750.
bedevere-bot commentedAug 17, 2023
🤖 New build scheduled with the buildbot fleet by@rhettinger for commitd3179bc 🤖 If you want to schedule another build, you need to add the🔨 test-with-buildbots label again. |
I can confirm the new tests fail without the fix 👍🏻 One thing I'm trying to find is why we needed the So I guess skipping the |
rhettinger commentedAug 18, 2023 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
The
In contrast, the |
By whom can it be called multiple times? I mean, yes, theoretically you can explicitly grab (yes, I agree that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM. And the resulting code looks clearer.
Moving the code from__init__
to__new__
can break pickling, but OrderedDict uses full constructor instead of__new__
in pickling, so it is safe from this side.
Thanks@rhettinger for the PR, and@ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12. |
bedevere-bot commentedAug 21, 2023
GH-108200 is a backport of this pull request to the3.12 branch. |
bedevere-bot commentedAug 21, 2023
GH-108201 is a backport of this pull request to the3.11 branch. |
…ersion (pythonGH-108098)(cherry picked from commit20cc90c)Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
…ersion (pythonGH-108098)(cherry picked from commit20cc90c)Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Side note. "gh-" in the title should be in lower case, and the issue number should be separated by a colon from the rest of the text. I think this is the reason why other Raymond's PRs were not automatically linked from the corresponding issue. |
Uh oh!
There was an error while loading.Please reload this page.
This solves a problem noticed in the referenced issue. When
__init__
is overridden, the C version is still usable but the pure Python version fails. The solution is to have the internal invariants sets up in__new__
rather than__init__
.The original copy/pickle issue still remains.