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
Right now static typing isn't really supported, and we are basically forced to turn it off via
from cached_property import cached_property # type: ignore
What seems to work pretty well is to pretend to mypy that cached_property is the same as property, that is, write a cached_property.pyi stub file with just
cached_property = property
and then manually point mypy at it. Ideally that would be part of the out-of-the-box experience. For that we would need to either push support into typeshed or:
Rewrite cached_property.py into a package (code goes into cached_property/__init__.py or import it from there)
Right now static typing isn't really supported, and we are basically forced to turn it off via
What seems to work pretty well is to pretend to mypy that cached_property is the same as property, that is, write a
cached_property.pyi
stub file with justand then manually point mypy at it. Ideally that would be part of the out-of-the-box experience. For that we would need to either push support into typeshed or:
cached_property/__init__.py
or import it from there)cached_property/__init__.pyi
stubcached_property/py.typed
marker as in https://www.python.org/dev/peps/pep-0561/With #26 we wouldn't need the stub pyi file but the
py.typed
marker and refactoring into a package would still be required.The text was updated successfully, but these errors were encountered: