-
Notifications
You must be signed in to change notification settings - Fork 216
Closed
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation
Milestone
Description
Summary
Currently the type of a functools.cached_property is Unknown, as the standardlibrary .functools does not have type annotations
from functools import cached_property
from typing import reveal_type
class Foo:
@cached_property
def foo(self) -> str:
return "This is expensive"
reveal_type(Foo().foo)Output:
info[revealed-type]: Revealed type
--> main.py:11:11
|
11 | reveal_type(Foo().foo)
| ^^^^^^^^^ `Unknown`
|
Expected:
Some variant of bound method Foo.foo() -> str, which is what ty reveals without the decorator.
Is this an issue with typeshed?
Version
ty 0.0.1-alpha.24
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
genericsBugs or features relating to ty's generics implementationBugs or features relating to ty's generics implementation