Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-43977: Properly update the tp_flags of existing subclasses when their parents are register'd #26864

Merged
merged 5 commits into from
Jun 25, 2021

Conversation

brandtbucher
Copy link
Member

@brandtbucher brandtbucher commented Jun 22, 2021

Currently, the Py_TPFLAGS_MAPPING and Py_TPFLAGS_SEQUENCE flags aren't set correctly on child classes created before their parent is registered as aMapping or Sequence.

When setting these flags, recurse through the tree of existing subclasses and set their flags too.

https://bugs.python.org/issue43977

@brandtbucher brandtbucher added type-bug An unexpected behavior, bug, or error docs Documentation in the Doc dir needs backport to 3.10 only security fixes labels Jun 22, 2021
@markshannon
Copy link
Member

This could represent a change to PEP 634, depending on how you read it.
Could you add a clarification to PEP 634 as well, stating that the order of registering and subclassing is unimportant.

@brandtbucher brandtbucher merged commit ca2009d into python:main Jun 25, 2021
@miss-islington
Copy link
Contributor

Thanks @brandtbucher for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jun 25, 2021
…heir parents are registered (pythonGH-26864)

(cherry picked from commit ca2009d)

Co-authored-by: Brandt Bucher <brandt@python.org>
@bedevere-bot
Copy link

GH-26908 is a backport of this pull request to the 3.10 branch.

@bedevere-bot bedevere-bot removed the needs backport to 3.10 only security fixes label Jun 25, 2021
miss-islington added a commit that referenced this pull request Jun 25, 2021
…heir parents are registered (GH-26864)

(cherry picked from commit ca2009d)

Co-authored-by: Brandt Bucher <brandt@python.org>
@brandtbucher brandtbucher deleted the late-registration branch July 21, 2022 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants