From cfb385fd45e4cbf69074729bb10afd031b131233 Mon Sep 17 00:00:00 2001 From: Akuli Date: Fri, 28 Jan 2022 14:23:59 +0200 Subject: [PATCH 1/3] Do not cast zip, delete old TODO comment --- mypy/checkexpr.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index 9bf3ec3a4456..b5238a040341 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -1607,8 +1607,7 @@ 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: - # TODO: fix signature of zip() in typeshed. - returns, inferred_types = cast(Any, zip)(*unioned_return) + returns, inferred_types = 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 From d6da0a46f39210755ef1becc8fa808386856e8f9 Mon Sep 17 00:00:00 2001 From: Akuli Date: Fri, 28 Jan 2022 14:26:01 +0200 Subject: [PATCH 2/3] Delete a couple unnecessary asserts and their TODO comment --- mypy/ipc.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/mypy/ipc.py b/mypy/ipc.py index 8a6a310d7ff8..f48ac18075d8 100644 --- a/mypy/ipc.py +++ b/mypy/ipc.py @@ -54,9 +54,6 @@ def read(self, size: int = 100000) -> bytes: if sys.platform == 'win32': while True: ov, err = _winapi.ReadFile(self.connection, size, overlapped=True) - # TODO: remove once typeshed supports Literal types - assert isinstance(ov, _winapi.Overlapped) - assert isinstance(err, int) try: if err == _winapi.ERROR_IO_PENDING: timeout = int(self.timeout * 1000) if self.timeout else _winapi.INFINITE From 4c4dd684f9f7b99e09fc1c83e24e27986f6c2843 Mon Sep 17 00:00:00 2001 From: Akuli Date: Fri, 28 Jan 2022 16:33:41 +0200 Subject: [PATCH 3/3] remove unused import --- mypy/checkexpr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mypy/checkexpr.py b/mypy/checkexpr.py index b5238a040341..36f92898edb7 100644 --- a/mypy/checkexpr.py +++ b/mypy/checkexpr.py @@ -4,7 +4,7 @@ from contextlib import contextmanager import itertools from typing import ( - Any, cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator + cast, Dict, Set, List, Tuple, Callable, Union, Optional, Sequence, Iterator ) from typing_extensions import ClassVar, Final, overload, TypeAlias as _TypeAlias