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
test.py:12:16 - error: Expression of type "None" cannot be assigned to declared type "property"
Type "None" cannot be assigned to type "property" (reportGeneralTypeIssues)
1 error, 0 warnings, 0 informations
Expected behavior
The property is allowed to be overridden.
Additional context
The code does not error when run against mypy==0.990.
The text was updated successfully, but these errors were encountered:
This is intended behavior. The abstract class indicates that the symbol sub_type must be a read-only property. In the subclass, you are attempting to implement it using a read/write attribute. The semantics for properties and attributes are similar, but they differ in important ways. If your abstract base class indicates that the type of a symbol is a property, a subclass must implement this symbol as a property for it to satisfy the base class requirements.
The following will eliminate the type violation in your code:
Note: if you are reporting a wrong signature of a function or a class in the standard library, then the typeshed tracker is better suited for this report: https://github.com/python/typeshed/issues.
Describe the bug
This is related to #2601 but applies to a
@property
in the abstract base class.To Reproduce
Create a base class that has an abstract property:
Expected behavior
The property is allowed to be overridden.
Additional context
The code does not error when run against
mypy==0.990
.The text was updated successfully, but these errors were encountered: