Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions mypy/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
from contextlib import contextmanager

from typing import (
Dict, Set, List, cast, Tuple, TypeVar, Union, Optional, NamedTuple, Iterator, Iterable,
Sequence, Mapping, Generic, AbstractSet, Callable
Any, Dict, Set, List, cast, Tuple, TypeVar, Union, Optional, NamedTuple, Iterator,
Iterable, Sequence, Mapping, Generic, AbstractSet, Callable
)
from typing_extensions import Final

Expand Down Expand Up @@ -2600,7 +2600,8 @@ def check_multi_assignment_from_union(self, lvalues: List[Expression], rvalue: E
assert declared_type is not None
clean_items.append((type, declared_type))

types, declared_types = zip(*clean_items)
# TODO: fix signature of zip() in typeshed.
types, declared_types = cast(Any, zip)(*clean_items)
self.binder.assign_type(expr,
make_simplified_union(list(types)),
make_simplified_union(list(declared_types)),
Expand Down
5 changes: 3 additions & 2 deletions mypy/checkexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from contextlib import contextmanager
import itertools
from typing import (
cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator
Any, cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator
)
from typing_extensions import ClassVar, Final, overload

Expand Down Expand Up @@ -1518,7 +1518,8 @@ def check_overload_call(self,
# Record if we succeeded. Next we need to see if maybe normal procedure
# gives a narrower type.
if unioned_return:
returns, inferred_types = zip(*unioned_return)
# TODO: fix signature of zip() in typeshed.
returns, inferred_types = cast(Any, zip)(*unioned_return)
# Note that we use `combine_function_signatures` instead of just returning
# a union of inferred callables because for example a call
# Union[int -> int, str -> str](Union[int, str]) is invalid and
Expand Down