Class inheriting from property doesn't typecheck properly when used as a decorator #6158
Labels
bug
mypy got something wrong
false-positive
mypy gave an error on correct code
priority-1-normal
topic-descriptors
Properties, class vs. instance attributes
I have a custom class inheriting from
property
. When I go to use this as a decorator though mypy seems to miss that it's a property at all. This is with Python 3.6.3 and mypy 0.650.Example:
Running mypy on this gives the following output:
mypy minimal2.py
Contrast this with the same code with the builtin property which typechecks fine:
It's possible that this is related to #1529 where @ilevkivskyi suggested that:
Is subclassing
property
frowned upon (or just not supported in mypy?).The text was updated successfully, but these errors were encountered: