This makes it easier to read and edit (and review changes to) these files as source, even though it doesn't affect the rendering.
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]