Closed
Description
This code is not considered valid by mypy:
from abc import abstractmethod
class Array(object):
@property
@abstractmethod
def _length_(self) -> int: ...
@_length_.setter
@abstractmethod
def _length_(self, value: int) -> None: ...
Output:
out/ex.py:4: error: Overloaded method has both abstract and non-abstract variants
out/ex.py:7: error: Decorated property not supported
But, this code is valid:
- It works in runtime
- It is documented here: https://docs.python.org/3/library/abc.html#abc.abstractproperty
- It has clear semantics: we need subclasses of this type to have a read/write property implementation
Refs python/typeshed#6361