[pep-649] Clean up formatting (GH-2048)
One code-block was added, and fixed a couple of places where URLs were formatted as quotations.
This commit is contained in:
parent
8b0a9a2b55
commit
5f7d16f7df
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue