Clarify 649 wrt annotations inside flow control.
This commit is contained in:
parent
33b7bdcf94
commit
9a4b7c6071
11
pep-0649.rst
11
pep-0649.rst
|
@ -239,11 +239,12 @@ The good news is, neither is common, and neither is considered good
|
||||||
practice. In fact, they're rarely seen outside of Python's own
|
practice. In fact, they're rarely seen outside of Python's own
|
||||||
regression test suite. They are:
|
regression test suite. They are:
|
||||||
|
|
||||||
* *Code that sets annotations from inside any kind of
|
* *Code that sets annotations on module or class attributes
|
||||||
flow control statement.* It's currently possible to set
|
from inside any kind of flow control statement.* It's
|
||||||
module and class attributes with annotations inside an
|
currently possible to set module and class attributes with
|
||||||
``if`` or ``try`` statement, and it works as one would expect.
|
annotations inside an ``if`` or ``try`` statement, and it works
|
||||||
It's untenable to support this behavior when this PEP is active.
|
as one would expect. It's untenable to support this behavior
|
||||||
|
when this PEP is active.
|
||||||
* *Code in module or class scope that references or modifies the
|
* *Code in module or class scope that references or modifies the
|
||||||
local* ``__annotations__`` *dict directly.* Currently, when
|
local* ``__annotations__`` *dict directly.* Currently, when
|
||||||
setting annotations on module or class attributes, the generated
|
setting annotations on module or class attributes, the generated
|
||||||
|
|
Loading…
Reference in New Issue