◐ Shell
reader mode source ↗
Skip to content

gh-119180: PEP 649 compiler changes#119361

Merged
JelleZijlstra merged 77 commits into
python:mainfrom
JelleZijlstra:pep649-compile
Jun 11, 2024
Merged

gh-119180: PEP 649 compiler changes#119361
JelleZijlstra merged 77 commits into
python:mainfrom
JelleZijlstra:pep649-compile

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented May 21, 2024

Copy link
Copy Markdown
Member

This implements the compiler changes in PEP-649, creating a compiler-generated __annotate__ function that holds the function, class, and module annotations.

I commented on Discuss on some of the CPython tests I needed to change: https://discuss.python.org/t/pep-649-deferred-evaluation-of-annotations-tentatively-accepted/21331/60

I tried this branch on a few prominent runtime typing projects; my notes are in the issue description (#119180). Mostly there are few issues, except a few places that need adjustment because they were checking for annotations in the __dict__ directly.

@bedevere-app bedevere-app Bot mentioned this pull request May 21, 2024
30 tasks
88 hidden items Load more…
…s on

This makes it so functools.update_wrapper can always copy __annotate__ without having
to worry about whether or not the future is enabled.
@JelleZijlstra

Copy link
Copy Markdown
Member Author

Any further feedback on this PR? Getting this in will make it possible to start working on the Python-level parts of the PEP, which can be done in smaller chunks.

@AlexWaygood AlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hide comment

The bits I feel qualified to comment on all look good to me!

@JelleZijlstra JelleZijlstra enabled auto-merge (squash) June 11, 2024 05:07
@JelleZijlstra JelleZijlstra merged commit 9b8611e into python:main Jun 11, 2024
@JelleZijlstra JelleZijlstra deleted the pep649-compile branch June 11, 2024 13:08
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants