Visitar URL original
bpo-43977: Properly update the `tp_flags` of existing subclasses when their parents are `register`'d by brandtbucher · Pull Request #26864 · python/cpython · GitHub
The Wayback Machine - https://web.archive.org/web/20220203014700/https://github.com/python/cpython/pull/26864
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

@markshannon
Copy link
Contributor

@markshannon markshannon commented Jun 23, 2021

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
13 checks passed
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Jun 25, 2021

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

miss-islington added a commit to miss-islington/cpython that referenced this issue 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

@bedevere-bot bedevere-bot commented Jun 25, 2021

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

miss-islington added a commit that referenced this issue Jun 25, 2021
…heir parents are registered (GH-26864)

(cherry picked from commit ca2009d)

Co-authored-by: Brandt Bucher <brandt@python.org>
JuniorJPDJ added a commit to JuniorJPDJ/cpython that referenced this issue Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants