mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-30 13:51:37 +00:00
288 B
288 B
Class defenitions 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 C(C): ...
reveal_type(C) # revealed: Literal[C]