Skip to content

Commit 7d72700

Browse files
authored
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.
1 parent 19634b7 commit 7d72700

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pep-0563.rst

+6-4
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,16 @@ valid. They can use local names or the fully qualified name. Example::
261261

262262
def method(self) -> D.field2: # this FAILS, class D is local to C
263263
... # and is therefore only available
264-
# as C.D.
264+
# as C.D. This was already true
265+
# before the PEP.
265266

266267
def method(self) -> field2: # this is OK
267268
...
268269

269-
def method(self) -> field: # this FAILS, class D doesn't
270-
... # see C's attributes. This was
271-
# already true before this PEP.
270+
def method(self) -> field: # this FAILS, field is local to C and
271+
# is therefore not visible to D unless
272+
# accessed as C.field. This was already
273+
# true before the PEP.
272274

273275
In the presence of an annotation that isn't a syntactically valid
274276
expression, SyntaxError is raised at compile time. However, since names

0 commit comments

Comments
 (0)