mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 05:45:24 +00:00

## Summary Just fix typos. ## Test Plan CI tests. --------- Co-authored-by: Micha Reiser <micha@reiser.io>
467 B
467 B
Class definitions in stubs
Cyclical class definition
In type stubs, classes can reference themselves in their base class definitions. For example, in
typeshed
, we have class str(Sequence[str]): ...
.
class Foo[T]: ...
# TODO: actually is subscriptable
# error: [non-subscriptable]
class Bar(Foo[Bar]): ...
reveal_type(Bar) # revealed: Literal[Bar]
reveal_type(Bar.__mro__) # revealed: tuple[Literal[Bar], Unknown, Literal[object]]