Skip to content

__qualname__ and __module__ are available in class bodies#16215

Merged
hauntsaninja merged 2 commits intopython:masterfrom
asottile:qualname-module-class-body
Oct 4, 2023
Merged

__qualname__ and __module__ are available in class bodies#16215
hauntsaninja merged 2 commits intopython:masterfrom
asottile:qualname-module-class-body

Conversation

@asottile
Copy link
Copy Markdown
Contributor

@asottile asottile commented Oct 2, 2023

Resolves #10570
Resolves #6473

@asottile
Copy link
Copy Markdown
Contributor Author

asottile commented Oct 2, 2023

tbh idk what I'm doing -- I assume there's a better place to add these

@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Thanks for the fix!

(It's possible we should be putting these into the symbol tables or something, but given that type in typeshed has these attrs, I can't think of a way it would make a difference)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Oct 4, 2023

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninja hauntsaninja merged commit b1ba661 into python:master Oct 4, 2023
@asottile asottile deleted the qualname-module-class-body branch October 4, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Class attributes __qualname__ and __module__ should be accessible within class body mypy does not recognize __qualname__

2 participants