You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

74 lines
2.5 KiB

  1. from typing import Any
  2. from typing import Dict
  3. from typing import Generic
  4. from typing import Iterable
  5. from typing import Iterator
  6. from typing import Mapping
  7. from typing import Optional
  8. from typing import Tuple
  9. from typing import Type
  10. from typing import Union
  11. from typing import overload
  12. from ._protocols import IterableItems
  13. from ._protocols import MapItems
  14. from ._protocols import MapKeys
  15. from ._protocols import MapMutation
  16. from ._protocols import MapValues
  17. from ._protocols import HT
  18. from ._protocols import KT
  19. from ._protocols import T
  20. from ._protocols import VT_co
  21. class Map(Mapping[KT, VT_co]):
  22. @overload
  23. def __init__(self) -> None: ...
  24. @overload
  25. def __init__(self: Map[str, VT_co], **kw: VT_co) -> None: ...
  26. @overload
  27. def __init__(
  28. self, __col: Union[IterableItems[KT, VT_co], Iterable[Tuple[KT, VT_co]]]
  29. ) -> None: ...
  30. @overload
  31. def __init__(
  32. self: Map[Union[KT, str], VT_co],
  33. __col: Union[IterableItems[KT, VT_co], Iterable[Tuple[KT, VT_co]]],
  34. **kw: VT_co
  35. ) -> None: ...
  36. def __reduce__(self) -> Tuple[Type[Map[KT, VT_co]], Tuple[Dict[KT, VT_co]]]: ...
  37. def __len__(self) -> int: ...
  38. def __eq__(self, other: Any) -> bool: ...
  39. @overload
  40. def update(
  41. self,
  42. __col: Union[IterableItems[KT, VT_co], Iterable[Tuple[KT, VT_co]]]
  43. ) -> Map[KT, VT_co]: ...
  44. @overload
  45. def update(
  46. self: Map[Union[HT, str], Any],
  47. __col: Union[IterableItems[KT, VT_co], Iterable[Tuple[KT, VT_co]]],
  48. **kw: VT_co # type: ignore[misc]
  49. ) -> Map[KT, VT_co]: ...
  50. @overload
  51. def update(
  52. self: Map[Union[HT, str], Any],
  53. **kw: VT_co # type: ignore[misc]
  54. ) -> Map[KT, VT_co]: ...
  55. def mutate(self) -> MapMutation[KT, VT_co]: ...
  56. def set(self, key: KT, val: VT_co) -> Map[KT, VT_co]: ... # type: ignore[misc]
  57. def delete(self, key: KT) -> Map[KT, VT_co]: ...
  58. @overload
  59. def get(self, key: KT) -> Optional[VT_co]: ...
  60. @overload
  61. def get(self, key: KT, default: Union[VT_co, T]) -> Union[VT_co, T]: ...
  62. def __getitem__(self, key: KT) -> VT_co: ...
  63. def __contains__(self, key: Any) -> bool: ...
  64. def __iter__(self) -> Iterator[KT]: ...
  65. def keys(self) -> MapKeys[KT]: ... # type: ignore[override]
  66. def values(self) -> MapValues[VT_co]: ... # type: ignore[override]
  67. def items(self) -> MapItems[KT, VT_co]: ... # type: ignore[override]
  68. def __hash__(self) -> int: ...
  69. def __dump__(self) -> str: ...
  70. def __class_getitem__(cls, item: Any) -> Type[Map[Any, Any]]: ...