diff --git a/requirements-tests.txt b/requirements-tests.txt index 421bea5ac52f..e84fccd25e21 100644 --- a/requirements-tests.txt +++ b/requirements-tests.txt @@ -5,7 +5,7 @@ flake8-bugbear==22.10.27 # must match .pre-commit-config.yaml flake8-noqa==1.2.9 # must match .pre-commit-config.yaml flake8-pyi==22.10.0 # must match .pre-commit-config.yaml isort==5.10.1 # must match .pre-commit-config.yaml -mypy==0.982 +mypy==0.990 packaging==21.3 pathspec pycln==2.1.1 # must match .pre-commit-config.yaml diff --git a/stdlib/importlib/abc.pyi b/stdlib/importlib/abc.pyi index 7abe26d97268..c961fb2e1f9e 100644 --- a/stdlib/importlib/abc.pyi +++ b/stdlib/importlib/abc.pyi @@ -179,6 +179,7 @@ if sys.version_info >= (3, 9): self, mode: str, buffering: int = ..., encoding: str | None = ..., errors: str | None = ..., newline: str | None = ... ) -> IO[Any]: ... @property + @abstractmethod def name(self) -> str: ... @abstractmethod def __truediv__(self, child: str) -> Traversable: ... diff --git a/test_cases/stdlib/asyncio/check_task.py b/test_cases/stdlib/asyncio/check_task.py index d674c44abb8b..69bcf8f782aa 100644 --- a/test_cases/stdlib/asyncio/check_task.py +++ b/test_cases/stdlib/asyncio/check_task.py @@ -15,7 +15,7 @@ async def join(self) -> None: async def foo() -> int: - ... + return 42 async def main() -> None: diff --git a/test_cases/stdlib/builtins/check_dict.py b/test_cases/stdlib/builtins/check_dict.py index b2def8b9a017..3ba6ce89a7a4 100644 --- a/test_cases/stdlib/builtins/check_dict.py +++ b/test_cases/stdlib/builtins/check_dict.py @@ -16,11 +16,13 @@ class KeysAndGetItem(Generic[_KT, _VT]): + data: Dict[_KT, _VT] + def keys(self) -> Iterable[_KT]: - ... + return self.data.keys() def __getitem__(self, __k: _KT) -> _VT: - ... + return self.data[__k] kt1: KeysAndGetItem[int, str] = KeysAndGetItem() diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 29241c85f051..03db863c07d3 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -438,6 +438,17 @@ types.WrapperDescriptorType.__get__ typing.[A-Z]\w+ typing_extensions\..* +# These are abstract properties at runtime, +# but marking them as such in the stub breaks half the the typed-Python ecosystem (see #8726) +typing.IO.closed +typing.IO.mode +typing.IO.name +typing.TextIO.buffer +typing.TextIO.encoding +typing.TextIO.errors +typing.TextIO.line_buffering +typing.TextIO.newlines + # Typing-related weirdness _collections_abc.Callable _typeshed.* # Utility types for typeshed, doesn't exist at runtime