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
|
||||
regression test suite. They are:
|
||||
|
||||
* *Code that sets annotations from inside any kind of
|
||||
flow control statement.* It's currently possible to set
|
||||
module and class attributes with annotations inside an
|
||||
``if`` or ``try`` statement, and it works as one would expect.
|
||||
It's untenable to support this behavior when this PEP is active.
|
||||
* *Code that sets annotations on module or class attributes
|
||||
from inside any kind of flow control statement.* It's
|
||||
currently possible to set module and class attributes with
|
||||
annotations inside an ``if`` or ``try`` statement, and it works
|
||||
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
|
||||
local* ``__annotations__`` *dict directly.* Currently, when
|
||||
setting annotations on module or class attributes, the generated
|
||||
|
|
Loading…
Reference in New Issue