-
Notifications
You must be signed in to change notification settings - Fork 277
Closed
Labels
topic: otherOther topics not coveredOther topics not covered
Description
The following reproducer code returns the __init__ method of a class:
from typing import Any
def f(cls: type) -> Any:
return cls.__init__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?
Metadata
Metadata
Assignees
Labels
topic: otherOther topics not coveredOther topics not covered