mirror of https://github.com/astral-sh/ruff
add failing test
This commit is contained in:
parent
c02bd11b93
commit
ed8a7af5e2
|
|
@ -407,4 +407,21 @@ def f_okay(c: Callable[[], None]):
|
||||||
c.__qualname__ = "my_callable" # okay
|
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
|
[gradual form]: https://typing.python.org/en/latest/spec/glossary.html#term-gradual-form
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue