Typed classproperty.fget

This commit is contained in:
Sengolda 2021-10-28 01:19:03 +05:30 committed by GitHub
parent cbc0e92e5d
commit 19c4a7ebdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -170,7 +170,7 @@ class CachedSlotProperty(Generic[T, T_co]):
class classproperty(Generic[T_co]):
def __init__(self, fget: Callable[[Any], T_co]) -> None:
self.fget = fget
self.fget: Callable[[Any], T_co] = fget
def __get__(self, instance: Optional[Any], owner: Type[Any]) -> T_co:
return self.fget(owner)