Debian Codegraph @

test-data/unit/fixtures/paramspec.pyi

raw
1 # builtins stub for paramspec-related test cases
2
3 import _typeshed
4 from typing import (
5 Sequence, Generic, TypeVar, Iterable, Iterator, Tuple, Mapping, Optional, Union, Type, overload,
6 Protocol
7 )
8
9 T = TypeVar("T")
10 T_co = TypeVar('T_co', covariant=True)
11 KT = TypeVar("KT")
12 VT = TypeVar("VT")
13
14 class object:
15 def __init__(self) -> None: ...
16
17 class function: ...
18 class ellipsis: ...
19 class classmethod: ...
20
21 class type:
22 def __init__(self, *a: object) -> None: ...
23 def __call__(self, *a: object) -> object: ...
24
25 class list(Sequence[T], Generic[T]):
26 @overload
27 def __getitem__(self, i: int) -> T: ...
28 @overload
29 def __getitem__(self, s: slice) -> list[T]: ...
30 def __contains__(self, item: object) -> bool: ...
31 def __iter__(self) -> Iterator[T]: ...
32
33 class int:
34 def __neg__(self) -> int: ...
35 def __add__(self, other: int) -> int: ...
36
37 class bool(int): ...
38 class float: ...
39 class slice: ...
40 class str: ...
41 class bytes: ...
42
43 class tuple(Sequence[T_co], Generic[T_co]):
44 def __new__(cls: Type[T], iterable: Iterable[T_co] = ...) -> T: ...
45 def __iter__(self) -> Iterator[T_co]: ...
46 def __contains__(self, item: object) -> bool: ...
47 def __getitem__(self, x: int) -> T_co: ...
48 def __mul__(self, n: int) -> Tuple[T_co, ...]: ...
49 def __rmul__(self, n: int) -> Tuple[T_co, ...]: ...
50 def __add__(self, x: Tuple[T_co, ...]) -> Tuple[T_co, ...]: ...
51 def __len__(self) -> int: ...
52 def count(self, obj: object) -> int: ...
53
54 class _ItemsView(Iterable[Tuple[KT, VT]]): ...
55
56 class dict(Mapping[KT, VT]):
57 @overload
58 def __init__(self, **kwargs: VT) -> None: ...
59 @overload
60 def __init__(self, arg: Iterable[Tuple[KT, VT]], **kwargs: VT) -> None: ...
61 def __getitem__(self, key: KT) -> VT: ...
62 def __setitem__(self, k: KT, v: VT) -> None: ...
63 def __iter__(self) -> Iterator[KT]: ...
64 def __contains__(self, item: object) -> int: ...
65 def update(self, a: Mapping[KT, VT]) -> None: ...
66 @overload
67 def get(self, key: KT, default: None = None, /) -> Optional[VT]: ...
68 @overload
69 def get(self, key: KT, default: VT, /) -> VT: ...
70 @overload
71 def get(self, key: KT, default: T, /) -> Union[VT, T]: ...
72 def __len__(self) -> int: ...
73 def pop(self, k: KT) -> VT: ...
74 def items(self) -> _ItemsView[KT, VT]: ...
75
76 def isinstance(x: object, t: type) -> bool: ...
77
78 class _Sized(Protocol):
79 def __len__(self) -> int: ...
80
81 def len(x: _Sized) -> int: ...