@@ -2,13 +2,14 @@ PEP: 749
2
2
Title: Implementing PEP 649
3
3
Author: Jelle Zijlstra <jelle.zijlstra@gmail.com>
4
4
Discussions-To: https://discuss.python.org/t/pep-749-implementing-pep-649/54974
5
- Status: Draft
5
+ Status: Accepted
6
6
Type: Standards Track
7
7
Topic: Typing
8
8
Requires: 649
9
9
Created: 28-May-2024
10
10
Python-Version: 3.14
11
11
Post-History: `04-Jun-2024 <https://discuss.python.org/t/pep-749-implementing-pep-649/54974 >`__
12
+ Resolution: `05-May-2025 <https://discuss.python.org/t/pep-749-implementing-pep-649/54974/66 >`__
12
13
13
14
14
15
Abstract
@@ -36,7 +37,7 @@ specification:
36
37
* The ``SOURCE `` format is renamed to ``STRING `` to improve clarity and reduce the risk of
37
38
user confusion.
38
39
* Conditionally defined class and module annotations are handled correctly.
39
- * If annotations are accessed a partially executed module, the annotations executed so far
40
+ * If annotations are accessed on a partially executed module, the annotations executed so far
40
41
are returned, but not cached.
41
42
42
43
Motivation
@@ -633,7 +634,9 @@ Specification
633
634
An additional format, ``VALUE_WITH_FAKE_GLOBALS ``, is added to the ``Format `` enum in the
634
635
``annotationlib `` module, with value equal to 2. (As a result, the values of the
635
636
other formats will shift relative to PEP 649: ``FORWARDREF `` will be 3 and ``SOURCE ``
636
- will be 4.)
637
+ will be 4.) The integer values of these formats are specified for use in places where
638
+ the enum is not readily available, such as in ``__annotate__ `` functions implemented
639
+ in C.
637
640
638
641
Compiler-generated
639
642
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
875
878
is set only when module execution is complete. This is obviously
876
879
unintuitive.
877
880
878
- See `python/cpython#130907 `__ for implementation.
881
+ See `python/cpython#131550 `__ for implementation.
879
882
880
- __ https://github.com/python/cpython/issue/130907
883
+ __ https://github.com/python/cpython/pull/131550
881
884
882
885
Specification
883
886
-------------
0 commit comments