Merge pull request #8527 from tk0miya/8111_pretty_change

refactor: pretty change for isproperty()
This commit is contained in:
Takeshi KOMIYA 2020-12-14 01:33:01 +09:00 committed by GitHub
commit 8ed1e706cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -355,7 +355,7 @@ def iscoroutinefunction(obj: Any) -> bool:
def isproperty(obj: Any) -> bool: def isproperty(obj: Any) -> bool:
"""Check if the object is property.""" """Check if the object is property."""
if sys.version_info > (3, 8): if sys.version_info >= (3, 8):
from functools import cached_property # cached_property is available since py3.8 from functools import cached_property # cached_property is available since py3.8
if isinstance(obj, cached_property): if isinstance(obj, cached_property):
return True return True