Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PEP-563: Fixed a nested class example in #2007

Merged
merged 1 commit into from
Jun 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions pep-0563.rst
Original file line number Diff line number Diff line change
Expand Up @@ -259,14 +259,15 @@ valid. They can use local names or the fully qualified name. Example::
def method(self) -> C.D.field2: # this is OK
...

def method(self) -> D.field2: # this is OK
...
def method(self) -> D.field2: # this FAILS, class D is local to C
... # and is therefore only available
# as C.D.

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

def method(self) -> field: # this FAILS, class D doesn't
... # see C's attributes, This was
... # see C's attributes. This was
# already true before this PEP.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why mention this here and not in the previous example? And why not show the correct way (C.field) like you did there?


In the presence of an annotation that isn't a syntactically valid
Expand Down