Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions peps/pep-0749.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ PEP: 749
Title: Implementing PEP 649
Author: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Discussions-To: https://discuss.python.org/t/pep-749-implementing-pep-649/54974
Status: Draft
Status: Accepted
Type: Standards Track
Topic: Typing
Requires: 649
Created: 28-May-2024
Python-Version: 3.14
Post-History: `04-Jun-2024 <https://discuss.python.org/t/pep-749-implementing-pep-649/54974>`__
Resolution: `05-May-2025 <https://discuss.python.org/t/pep-749-implementing-pep-649/54974/66>`__


Abstract
Expand Down Expand Up @@ -36,7 +37,7 @@ specification:
* The ``SOURCE`` format is renamed to ``STRING`` to improve clarity and reduce the risk of
user confusion.
* Conditionally defined class and module annotations are handled correctly.
* If annotations are accessed a partially executed module, the annotations executed so far
* If annotations are accessed on a partially executed module, the annotations executed so far
are returned, but not cached.

Motivation
Expand Down Expand Up @@ -633,7 +634,9 @@ Specification
An additional format, ``VALUE_WITH_FAKE_GLOBALS``, is added to the ``Format`` enum in the
``annotationlib`` module, with value equal to 2. (As a result, the values of the
other formats will shift relative to PEP 649: ``FORWARDREF`` will be 3 and ``SOURCE``
will be 4.)
will be 4.) The integer values of these formats are specified for use in places where
the enum is not readily available, such as in ``__annotate__`` functions implemented
in C.

Compiler-generated
annotate functions will support this format and return the same value as
Expand Down Expand Up @@ -875,9 +878,9 @@ print an empty dictionary twice, because the ``__annotate__`` function
is set only when module execution is complete. This is obviously
unintuitive.
Comment on lines 878 to 879

Choose a reason for hiding this comment

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

This is perhaps not important anymore now that the PEP is accepted, but you might want to change this sentence, given that the "obviously unintuitive" behaviour is now what PEP 749 implements.

Copy link
Member Author

Choose a reason for hiding this comment

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

It's not what's currently implemented.


See `python/cpython#130907`__ for implementation.
See `python/cpython#131550`__ for implementation.

__ https://github.com/python/cpython/issue/130907
__ https://github.com/python/cpython/pull/131550

Specification
-------------
Expand Down