Skip to content

Commit

Permalink
[pep-649] Clean up formatting (GH-2048)
Browse files Browse the repository at this point in the history
One code-block was added, and fixed a couple of places where URLs were formatted as quotations.
  • Loading branch information
PythonCHB authored Sep 17, 2021
1 parent 8b0a9a2 commit 5f7d16f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pep-0649.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5f7d16f

Please sign in to comment.