From a3310aeeffa0a536e48fa58290bbc2cf412f0ae7 Mon Sep 17 00:00:00 2001 From: Peter Law Date: Sat, 29 Oct 2022 14:01:10 +0100 Subject: [PATCH] PEP 649: Fix nested list formatting (#2856) --- pep-0649.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pep-0649.rst b/pep-0649.rst index 695364fec..95c028347 100644 --- a/pep-0649.rst +++ b/pep-0649.rst @@ -199,9 +199,11 @@ them to their actual Python values. This has several drawbacks: implementation. * It requires that all annotations be evaluated at module-level scope. Annotations under :pep:`563` can no longer refer to + * class variables, * local variables in the current function, or * local variables in enclosing functions. + * It requires a code change every time existing code uses an annotation, to handle converting the stringized annotation back into a useful value. @@ -224,10 +226,12 @@ This PEP also solves the forward reference problem outlined in * Python implementations would generate annotations as code objects. This is simpler than stringizing, and is something Python implementations are already quite good at. This means: + - alternate implementations would need to write less code to - implement this feature, and + implement this feature, and - the implementation would be simpler overall, which should - reduce its ongoing maintenance cost. + reduce its ongoing maintenance cost. + * Existing annotations would not need to be changed to only use global scope. Actually, annotations would become much easier to use, as they would now also handle forward