__init__.pyi 2.5 KB

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