Type hinting with descriptors
问题 In this pull request it looks like type hinting support for descriptors was added. However it looks like no finalized "correct" usage example was ever posted, nor does it looks like any documentation was ever added to the typing module or to Mypy. It looks like the correct usage is something like this: from typing import TypeVar T = TypeVar('T') V = TypeVar('V') class classproperty(): def __init__(self, getter: Callable[[Type[T], V]) -> None: self.getter = getter def __get__(self, instance: