Skip to content

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

Merged
brandtbucher merged 5 commits into
python:mainfrom
brandtbucher:late-registration
Jun 25, 2021
Merged

bpo-43977: Properly update the tp_flags of existing subclasses when their parents are register'd#26864
brandtbucher merged 5 commits into
python:mainfrom
brandtbucher:late-registration

Conversation

@brandtbucher

@brandtbucher brandtbucher commented Jun 22, 2021

Copy link
Copy Markdown
Member

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
@brandtbucher brandtbucher requested a review from markshannon June 22, 2021 23:53
@markshannon

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown

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