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

GH-119462: Enforce invariants of type versioning #120731

Merged
merged 6 commits into from
Jun 19, 2024

Conversation

markshannon
Copy link
Member

@markshannon markshannon commented Jun 19, 2024

This PR enforces the following invariants:

  1. The version of all superclasses is always set if the version of any subclass is set.
  2. The version tag is valid iff the version tag is non-zero
  3. The version tag is invalid iff the version tag is zero

1 is required for correct functioning of the method cache and is an explicitly documented requirement.
2 and 3 are necessary for correct operation of the specializing interpreter.

Copy link
Member

@Fidget-Spinner Fidget-Spinner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few questions.

Objects/typeobject.c Outdated Show resolved Hide resolved
Objects/typeobject.c Show resolved Hide resolved
@markshannon markshannon merged commit 00257c7 into python:main Jun 19, 2024
38 checks passed
@miss-islington-app
Copy link

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

@miss-islington-app
Copy link

Sorry, @markshannon, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker 00257c746c447a2e026b5a2a618f0e033fb90111 3.13

@python python deleted a comment from miss-islington-app bot Jun 19, 2024
@python python deleted a comment from miss-islington-app bot Jun 19, 2024
markshannon added a commit to faster-cpython/cpython that referenced this pull request Jun 19, 2024
markshannon added a commit that referenced this pull request Jun 20, 2024
mrahtz pushed a commit to mrahtz/cpython that referenced this pull request Jun 30, 2024
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull request Jul 11, 2024
estyxx pushed a commit to estyxx/cpython that referenced this pull request Jul 17, 2024
@markshannon markshannon deleted the fix-119462 branch August 6, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs backport to 3.13 bugs and security fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants