diff --git a/peps/pep-0749.rst b/peps/pep-0749.rst index c50a2b4883b..f3ea7dbda3f 100644 --- a/peps/pep-0749.rst +++ b/peps/pep-0749.rst @@ -2,13 +2,14 @@ PEP: 749 Title: Implementing PEP 649 Author: Jelle Zijlstra 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 `__ +Resolution: `05-May-2025 `__ Abstract @@ -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 @@ -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 @@ -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. -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 -------------