Skip to content

Improve error message for direct __init__ calls #13183

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

Merged
merged 2 commits into from
Jul 19, 2022

Conversation

hauntsaninja
Copy link
Collaborator

Resolves #13173

@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

steam.py (https://github.com/Gobot1234/steam.py)
- steam/protobufs/struct_messages.py:33: error: Cannot access "__init__" directly  [misc]
+ steam/protobufs/struct_messages.py:33: error: Accessing "__init__" on an instance is unsound, since instance.__init__ could be from an incompatible subclass  [misc]

discord.py (https://github.com/Rapptz/discord.py)
- discord/ext/commands/core.py:534: error: Cannot access "__init__" directly
+ discord/ext/commands/core.py:534: error: Accessing "__init__" on an instance is unsound, since instance.__init__ could be from an incompatible subclass

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

LGTM

@hauntsaninja hauntsaninja merged commit 28258d0 into python:master Jul 19, 2022
@hauntsaninja hauntsaninja deleted the call-init branch July 19, 2022 21:23
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.

Cannot access "__init__" directly
3 participants