add failing test

This commit is contained in:
Douglas Creager 2025-12-16 13:06:46 -05:00
parent c02bd11b93
commit ed8a7af5e2
1 changed files with 17 additions and 0 deletions

View File

@ -407,4 +407,21 @@ def f_okay(c: Callable[[], None]):
c.__qualname__ = "my_callable" # okay
```
## From a class
### Subclasses should return themselves, not superclass
```py
from ty_extensions import into_callable
class Base:
def __init__(self) -> None: pass
class A(Base):
pass
# revealed: () -> A
reveal_type(into_callable(A))
```
[gradual form]: https://typing.python.org/en/latest/spec/glossary.html#term-gradual-form