Skip to content

PEP 749: Updates - #4316

Merged
JelleZijlstra merged 6 commits into
python:mainfrom
JelleZijlstra:pep749-classes
Apr 23, 2025
Merged

JelleZijlstra merged 6 commits into
python:mainfrom
JelleZijlstra:pep749-classes

Conversation

@JelleZijlstra

@JelleZijlstra JelleZijlstra commented Mar 21, 2025 •

Copy link
Copy Markdown
Member
  • Add discussion of conditional annotations
  • Add discussion of partially execute modules
  • Change plans on the metaclasses issue
  • Explain the motivation of the VALUE_WITH_FAKE_GLOBALS name
  • Adjust two APIs in annotationlib

📚 Documentation preview 📚: https://pep-previews--4316.org.readthedocs.build/

Comment thread peps/pep-0749.rst Resolved
Comment thread peps/pep-0749.rst Resolved
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Comment thread peps/pep-0749.rst Resolved
JelleZijlstra and others added 3 commits March 21, 2025 13:35
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
@JelleZijlstra JelleZijlstra changed the title PEP 749: Add conditional annotations and partially executed modules Apr 13, 2025
Comment thread peps/pep-0749.rst
with the ``__future__`` import enabled and has annotations, and a class using that metaclass is
defined without the ``__future__`` import, accessing ``.__annotations__`` on that class will yield
the wrong results. However, this bug already exists in previous versions of Python. It could be
fixed by setting the annotations at a different key in the class dict in this case too, but that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For my own reference: local branch pep649-annocache implements this but I decided it wasn't worth it.

Comment thread peps/pep-0749.rst Resolved
@JelleZijlstra
JelleZijlstra merged commit 8b44c5e into python:main Apr 23, 2025
@JelleZijlstra
JelleZijlstra deleted the pep749-classes branch April 23, 2025 02:03
ethanfurman pushed a commit to ethanfurman/peps that referenced this pull request Oct 8, 2026
* PEP 749: Add conditional annotations and partially executed modules

* Update peps/pep-0749.rst

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* Update peps/pep-0749.rst

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

* More updates

* More changes

* Update peps/pep-0749.rst

---------

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants