Debian Codegraph @

test-data/unit/fixtures/slice.pyi

raw
1 # Builtins stub used in slicing test cases.
2 from typing import Generic, TypeVar, Protocol
3 T = TypeVar('T')
4 _Tco = TypeVar('_Tco', covariant=True)
5
6 class SupportsIndex(Protocol):
7 def __index__(self) -> int: ...
8
9 class object:
10 def __init__(self): pass
11
12 class type: pass
13 class tuple(Generic[T]): pass
14 class function: pass
15
16 class int: pass
17 class str: pass
18
19 class slice(Generic[_Tco]): pass
20 class ellipsis: pass
21 class dict: pass
22 class list(Generic[T]):
23 def __getitem__(self, x: slice[SupportsIndex | None]) -> list[T]: pass