|
1 | | -From 59841ad393c749cce0da8cd270f8d3f672637e20 Mon Sep 17 00:00:00 2001 |
| 1 | +From 8985351bf6f917db1a7b15ffed95ec2357d9819d Mon Sep 17 00:00:00 2001 |
2 | 2 | From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> |
3 | | -Date: Wed, 18 Feb 2026 13:11:02 +0100 |
| 3 | +Date: Mon, 18 May 2026 17:33:09 +0200 |
4 | 4 | Subject: [PATCH] Adjust stubs to fix mypy lookup error due to circular |
5 | 5 | dependencies in stubs |
6 | 6 |
|
7 | 7 | --- |
8 | | - mypy/typeshed/stdlib/time.pyi | 6 +++--- |
9 | | - 1 file changed, 3 insertions(+), 3 deletions(-) |
| 8 | + mypy/typeshed/stdlib/__future__.pyi | 2 +- |
| 9 | + mypy/typeshed/stdlib/dis.pyi | 4 ++-- |
| 10 | + mypy/typeshed/stdlib/inspect.pyi | 4 ++-- |
| 11 | + mypy/typeshed/stdlib/itertools.pyi | 2 +- |
| 12 | + mypy/typeshed/stdlib/time.pyi | 6 +++--- |
| 13 | + 5 files changed, 9 insertions(+), 9 deletions(-) |
10 | 14 |
|
| 15 | +diff --git a/mypy/typeshed/stdlib/__future__.pyi b/mypy/typeshed/stdlib/__future__.pyi |
| 16 | +index aa445d22b..a90cf1edd 100644 |
| 17 | +--- a/mypy/typeshed/stdlib/__future__.pyi |
| 18 | ++++ b/mypy/typeshed/stdlib/__future__.pyi |
| 19 | +@@ -1,4 +1,4 @@ |
| 20 | +-from typing import TypeAlias |
| 21 | ++from typing_extensions import TypeAlias |
| 22 | + |
| 23 | + _VersionInfo: TypeAlias = tuple[int, int, int, str, int] |
| 24 | + |
| 25 | +diff --git a/mypy/typeshed/stdlib/dis.pyi b/mypy/typeshed/stdlib/dis.pyi |
| 26 | +index 984f932e3..0ad928934 100644 |
| 27 | +--- a/mypy/typeshed/stdlib/dis.pyi |
| 28 | ++++ b/mypy/typeshed/stdlib/dis.pyi |
| 29 | +@@ -2,7 +2,7 @@ import sys |
| 30 | + import types |
| 31 | + from collections.abc import Callable, Iterator |
| 32 | + from opcode import * # `dis` re-exports it as a part of public API |
| 33 | +-from typing import IO, Any, Final, NamedTuple, TypeAlias, overload |
| 34 | ++from typing import IO, Any, Final, NamedTuple, overload |
| 35 | + from typing_extensions import Self, deprecated, disjoint_base |
| 36 | + |
| 37 | + __all__ = [ |
| 38 | +@@ -41,7 +41,7 @@ else: |
| 39 | + |
| 40 | + # Strictly this should not have to include Callable, but mypy doesn't use FunctionType |
| 41 | + # for functions (python/mypy#3171) |
| 42 | +-_HaveCodeType: TypeAlias = types.MethodType | types.FunctionType | types.CodeType | type | Callable[..., Any] |
| 43 | ++_HaveCodeType = types.MethodType | types.FunctionType | types.CodeType | type | Callable[..., Any] |
| 44 | + |
| 45 | + if sys.version_info >= (3, 11): |
| 46 | + class Positions(NamedTuple): |
| 47 | +diff --git a/mypy/typeshed/stdlib/inspect.pyi b/mypy/typeshed/stdlib/inspect.pyi |
| 48 | +index cc39a7c9f..0ca4cff75 100644 |
| 49 | +--- a/mypy/typeshed/stdlib/inspect.pyi |
| 50 | ++++ b/mypy/typeshed/stdlib/inspect.pyi |
| 51 | +@@ -196,8 +196,8 @@ if sys.version_info >= (3, 14): |
| 52 | + |
| 53 | + modulesbyfile: dict[str, Any] |
| 54 | + |
| 55 | +-_GetMembersPredicateTypeGuard: TypeAlias = Callable[[Any], TypeGuard[_T]] |
| 56 | +-_GetMembersPredicateTypeIs: TypeAlias = Callable[[Any], TypeIs[_T]] |
| 57 | ++_GetMembersPredicateTypeGuard = Callable[[Any], TypeGuard[_T]] |
| 58 | ++_GetMembersPredicateTypeIs = Callable[[Any], TypeIs[_T]] |
| 59 | + _GetMembersPredicate: TypeAlias = Callable[[Any], bool] |
| 60 | + _GetMembersReturn: TypeAlias = list[tuple[str, _T]] |
| 61 | + |
| 62 | +diff --git a/mypy/typeshed/stdlib/itertools.pyi b/mypy/typeshed/stdlib/itertools.pyi |
| 63 | +index d26a4e1da..60e79bc2e 100644 |
| 64 | +--- a/mypy/typeshed/stdlib/itertools.pyi |
| 65 | ++++ b/mypy/typeshed/stdlib/itertools.pyi |
| 66 | +@@ -23,7 +23,7 @@ _T10 = TypeVar("_T10") |
| 67 | + |
| 68 | + _Step: TypeAlias = SupportsFloat | SupportsInt | SupportsIndex | SupportsComplex |
| 69 | + |
| 70 | +-_Predicate: TypeAlias = Callable[[_T], object] |
| 71 | ++_Predicate = Callable[[_T], object] |
| 72 | + |
| 73 | + # Technically count can take anything that implements a number protocol and has an add method |
| 74 | + # but we can't enforce the add method |
11 | 75 | diff --git a/mypy/typeshed/stdlib/time.pyi b/mypy/typeshed/stdlib/time.pyi |
12 | 76 | index ac53089b8..9b5344b32 100644 |
13 | 77 | --- a/mypy/typeshed/stdlib/time.pyi |
|
0 commit comments