From 5f7d16f7df5cc1723a7a67cf2a135d8792e33626 Mon Sep 17 00:00:00 2001 From: "Christopher H.Barker, PhD" Date: Thu, 16 Sep 2021 18:06:16 -0700 Subject: [PATCH] [pep-649] Clean up formatting (GH-2048) One code-block was added, and fixed a couple of places where URLs were formatted as quotations. --- pep-0649.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pep-0649.rst b/pep-0649.rst index fe33616c572..c5a0a2d28c3 100644 --- a/pep-0649.rst +++ b/pep-0649.rst @@ -326,6 +326,8 @@ from within the language. Therefore it's possible to write code that behaves differently based on whether annotations are evaluated at binding time or at access time, e.g. +.. code-block:: + mytype = str def foo(a:mytype): pass mytype = int @@ -364,7 +366,7 @@ module-level scope: IMO the inability of referencing class-level definitions from annotations on methods pretty much kills this idea. - https://mail.python.org/pipermail/python-dev/2017-November/150109.html +https://mail.python.org/pipermail/python-dev/2017-November/150109.html This led to a short discussion about extending lambda-ized annotations for methods to be able to refer to class-level @@ -373,7 +375,7 @@ scope. This idea, too, was quickly rejected. PEP 563 summarizes the above discussion here: - https://www.python.org/dev/peps/pep-0563/#keeping-the-ability-to-use-function-local-state-when-defining-annotations +https://www.python.org/dev/peps/pep-0563/#keeping-the-ability-to-use-function-local-state-when-defining-annotations What's puzzling is PEP 563's own changes to the scoping rules of annotations—it *also* doesn't permit annotations to reference @@ -400,7 +402,7 @@ Implementation There's a prototype implementation of this PEP, here: - https://github.com/larryhastings/co_annotations/ +https://github.com/larryhastings/co_annotations/ As of this writing, all features described in this PEP are implemented, and there are some rudimentary tests in the