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 a parent class has a property, created via decorators with a getter and setter. If you attempt to override the fset of the parent by using decorators in the subclass, mypy throws an error.
overloaded function has no attribute "setter" [attr-defined] on the decorator line in the subclass. overloaded function has no attribute "fset" [attr-defined] on the call to fset in the subclass.
If instead of using a decorator, the property is created in the parent class via the property() function like below, then mypy does not produce any errors.
It does seem to be the same problem, I couldn't find this exact problem when searching yesterday, if it makes sense feel free to close this in favor of the pre-existing one. I'll not the work-around I found to the problem in the other issue in case it proves helpful to anyone.
Bug Report
When a parent class has a property, created via decorators with a getter and setter. If you attempt to override the
fset
of the parent by using decorators in the subclass, mypy throws an error.To Reproduce
Expected Behavior
Mypy should produce no errors
Actual Behavior
Mypy produces the errors:
overloaded function has no attribute "setter" [attr-defined]
on the decorator line in the subclass.overloaded function has no attribute "fset" [attr-defined]
on the call to fset in the subclass.If instead of using a decorator, the property is created in the parent class via the
property()
function like below, then mypy does not produce any errors.Your Environment
mypy.ini
(and other config files): Default configurationThe text was updated successfully, but these errors were encountered: