ruff
25a31911 - [ty] Refine Callable class-decorator fallback for unknown results (#25250)

Commit
10 days ago
[ty] Refine Callable class-decorator fallback for unknown results (#25250) ## Summary This PR addresses a TODO from #25091 whereby we preserved the class binding for every `Callable` decorator. We now respect explicit return annotations on `Callable`. For example, this now remains a replacement rather than being treated as class-preserving: ```python from typing import Callable, TypeVar T = TypeVar("T") def decorator_factory() -> Callable[[type[object]], T]: raise NotImplementedError @decorator_factory() class Decorated: ... reveal_type(Decorated) # Unknown ```
Author
Parents
Loading