aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTaneli Hukkinen <hukkinj1@users.noreply.github.com>2020-05-09 13:14:55 +0200
committerYury Selivanov <yury@edgedb.com>2020-05-13 11:40:09 -0700
commit34a5fcf87e7fc762216095ac75e4d030aaca8587 (patch)
treef83a89ddecdeaab02153b15297967fe1746104fe
parent98158965b3b74db962394d35e3adf10cca9505cd (diff)
downloadimmutables-34a5fcf87e7fc762216095ac75e4d030aaca8587.tar.gz
immutables-34a5fcf87e7fc762216095ac75e4d030aaca8587.zip
Improve type annotations of Map.update and MapMutation.update
-rw-r--r--immutables/_map.pyi13
1 files changed, 10 insertions, 3 deletions
diff --git a/immutables/_map.pyi b/immutables/_map.pyi
index c483f8f..bea69f3 100644
--- a/immutables/_map.pyi
+++ b/immutables/_map.pyi
@@ -7,6 +7,7 @@ from typing import Literal
from typing import Mapping
from typing import MutableMapping
from typing import NoReturn
+from typing import overload
from typing import Tuple
from typing import Type
from typing import TypeVar
@@ -46,8 +47,11 @@ class Map(Mapping[K, V]):
def __reduce__(self) -> Tuple[Type[Map], Tuple[dict]]: ...
def __len__(self) -> int: ...
def __eq__(self, other: Any) -> bool: ...
+ @overload
+ def update(self, **kw: V) -> Map[str, V]: ...
+ @overload
def update(
- self, col: Union[Mapping[K, V], Iterable[Tuple[K, V]]] = ..., **kw: V
+ self, col: Union[Mapping[K, V], Iterable[Tuple[K, V]]], **kw: V
) -> Map[K, V]: ...
def mutate(self) -> MapMutation[K, V]: ...
def set(self, key: K, val: V) -> Map[K, V]: ...
@@ -79,9 +83,12 @@ class MapMutation(MutableMapping[K, V]):
def get(self, key: K, default: D = ...) -> Union[V, D]: ...
def __getitem__(self, key: K) -> V: ...
def __contains__(self, key: Any) -> bool: ...
+ @overload
+ def update(self, **kw: V) -> None: ...
+ @overload
def update(
- self, col: Union[Mapping[K, V], Iterable[Tuple[K, V]]] = ..., **kw: V
- ): ...
+ self, col: Union[Mapping[K, V], Iterable[Tuple[K, V]]], **kw: V
+ ) -> None: ...
def finish(self) -> Map[K, V]: ...
def __len__(self) -> int: ...
def __eq__(self, other: Any) -> bool: ...