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
I expect both D and E to produce errors (cannot override ClassVar with instance variable)
Actual Behavior
but only D does
$ mypy t2.py t2.py:7: error: Cannot override class variable (previously declared on base class "C") with instance variable [misc]Found 1 error in 1 file (checked 1 source file)
interestingly enough, if you leave out the setter it does produce a diagnostic -- so I suspect this should be an easy patch to that particular codepath:
Bug Report
this seems to be a special case for
@property
but probably shouldn't bea settable instance
@property
currently is allowed to override aClassVar
but I believe it should produce a diagnosticTo Reproduce
Expected Behavior
I expect both
D
andE
to produce errors (cannot overrideClassVar
with instance variable)Actual Behavior
but only
D
doesinterestingly enough, if you leave out the setter it does produce a diagnostic -- so I suspect this should be an easy patch to that particular codepath:
Your Environment
mypy.ini
(and other config files): n/aThe text was updated successfully, but these errors were encountered: