PEP-563: Fixed the comments for a few examples (#2013)
This commit fixes the wording in the comments for failing examples in the "Backwards Compatibility" section, as suggested by Guido in #2007.
This commit is contained in:
parent
19634b7425
commit
7d727005fd
10
pep-0563.rst
10
pep-0563.rst
|
@ -261,14 +261,16 @@ valid. They can use local names or the fully qualified name. Example::
|
||||||
|
|
||||||
def method(self) -> D.field2: # this FAILS, class D is local to C
|
def method(self) -> D.field2: # this FAILS, class D is local to C
|
||||||
... # and is therefore only available
|
... # and is therefore only available
|
||||||
# as C.D.
|
# as C.D. This was already true
|
||||||
|
# before the PEP.
|
||||||
|
|
||||||
def method(self) -> field2: # this is OK
|
def method(self) -> field2: # this is OK
|
||||||
...
|
...
|
||||||
|
|
||||||
def method(self) -> field: # this FAILS, class D doesn't
|
def method(self) -> field: # this FAILS, field is local to C and
|
||||||
... # see C's attributes. This was
|
# is therefore not visible to D unless
|
||||||
# already true before this PEP.
|
# accessed as C.field. This was already
|
||||||
|
# true before the PEP.
|
||||||
|
|
||||||
In the presence of an annotation that isn't a syntactically valid
|
In the presence of an annotation that isn't a syntactically valid
|
||||||
expression, SyntaxError is raised at compile time. However, since names
|
expression, SyntaxError is raised at compile time. However, since names
|
||||||
|
|
Loading…
Reference in New Issue