__init__.pyi 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. from typing import (
  2. ItemsView,
  3. Iterable,
  4. Iterator,
  5. KeysView,
  6. Mapping,
  7. TypeVar,
  8. ValuesView,
  9. )
  10. _T = TypeVar("_T")
  11. _KT_co = TypeVar("_KT_co", covariant=True)
  12. _VT_co = TypeVar("_VT_co", covariant=True)
  13. _KU_co = TypeVar("_KU_co", covariant=True)
  14. _VU_co = TypeVar("_VU_co", covariant=True)
  15. class HashTrieMap(Mapping[_KT_co, _VT_co]):
  16. def __init__(
  17. self,
  18. value: Mapping[_KT_co, _VT_co] | Iterable[tuple[_KT_co, _VT_co]] = {},
  19. **kwds: Mapping[_KT_co, _VT_co],
  20. ): ...
  21. def __getitem__(self, key: _KT_co) -> _VT_co: ...
  22. def __iter__(self) -> Iterator[_KT_co]: ...
  23. def __len__(self) -> int: ...
  24. def discard(self, key: _KT_co) -> HashTrieMap[_KT_co, _VT_co]: ...
  25. def items(self) -> ItemsView[_KT_co, _VT_co]: ...
  26. def keys(self) -> KeysView[_KT_co]: ...
  27. def values(self) -> ValuesView[_VT_co]: ...
  28. def remove(self, key: _KT_co) -> HashTrieMap[_KT_co, _VT_co]: ...
  29. def insert(
  30. self,
  31. key: _KT_co,
  32. val: _VT_co,
  33. ) -> HashTrieMap[_KT_co, _VT_co]: ...
  34. def update(
  35. self,
  36. *args: Mapping[_KU_co, _VU_co] | Iterable[tuple[_KU_co, _VU_co]],
  37. ) -> HashTrieMap[_KT_co | _KU_co, _VT_co | _VU_co]: ...
  38. @classmethod
  39. def convert(
  40. cls,
  41. value: Mapping[_KT_co, _VT_co] | Iterable[tuple[_KT_co, _VT_co]],
  42. ) -> HashTrieMap[_KT_co, _VT_co]: ...
  43. @classmethod
  44. def fromkeys(
  45. cls,
  46. keys: Iterable[_KT_co],
  47. value: _VT_co = None,
  48. ) -> HashTrieMap[_KT_co, _VT_co]: ...
  49. class HashTrieSet(frozenset[_T]):
  50. def __init__(self, value: Iterable[_T] = ()): ...
  51. def __iter__(self) -> Iterator[_T]: ...
  52. def __len__(self) -> int: ...
  53. def discard(self, value: _T) -> HashTrieSet[_T]: ...
  54. def remove(self, value: _T) -> HashTrieSet[_T]: ...
  55. def insert(self, value: _T) -> HashTrieSet[_T]: ...
  56. def update(self, *args: Iterable[_T]) -> HashTrieSet[_T]: ...
  57. class List(Iterable[_T]):
  58. def __init__(self, value: Iterable[_T] = (), *more: _T): ...
  59. def __iter__(self) -> Iterator[_T]: ...
  60. def __len__(self) -> int: ...
  61. def push_front(self, value: _T) -> List[_T]: ...
  62. def drop_first(self) -> List[_T]: ...
  63. class Queue(Iterable[_T]):
  64. def __init__(self, value: Iterable[_T] = (), *more: _T): ...
  65. def __iter__(self) -> Iterator[_T]: ...
  66. def __len__(self) -> int: ...
  67. def enqueue(self, value: _T) -> Queue[_T]: ...
  68. def dequeue(self, value: _T) -> Queue[_T]: ...
  69. @property
  70. def is_empty(self) -> _T: ...
  71. @property
  72. def peek(self) -> _T: ...