You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When you define a class variable on a class that references a method that returns Self from another class, MyPy thinks that Self is the class where the method is referenced/
Fixes#15934
I think this is a right thing to do, it may even fix some other rare
accidental `TypeVar` clashes not involving self-types. This causes a bit
of churn in tests, but not too much.
Bug Report
When you define a class variable on a class that references a method that returns
Self
from another class, MyPy thinks thatSelf
is the class where the method is referenced/To Reproduce
Expected Behavior
Mypy should not detect any errors.
Actual Behavior
Your Environment
mypy.ini
(and other config files):The text was updated successfully, but these errors were encountered: