Replies: 2 comments 6 replies
-
The error isn't incorrect, cls is technically an instance of type and so accessing init which isn't checked for violations of the LSP is technically unsafe |
Beta Was this translation helpful? Give feedback.
5 replies
-
Is this a bug that mypy is tracking, if yes, can anyone share the issue link? I am also seeing the same issue. Can anyone enlighten me ? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The following reproducer code returns the
__init__
method of a class:but mypy considers that the
__init__
method was accessed from an instance:main.py:4: error: Accessing "__init__" on an instance is unsound, since instance.__init__ could be from an incompatible subclass [misc]
Where is the problem?
Beta Was this translation helpful? Give feedback.
All reactions