|
1 | | -From 59841ad393c749cce0da8cd270f8d3f672637e20 Mon Sep 17 00:00:00 2001 |
| 1 | +From 8c95839ee9db3bc899c6a19427253f6efbca3214 Mon Sep 17 00:00:00 2001 |
2 | 2 | From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> |
3 | 3 | Date: Wed, 18 Feb 2026 13:11:02 +0100 |
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/dis.pyi | 4 ++-- |
| 9 | + mypy/typeshed/stdlib/inspect.pyi | 4 ++-- |
| 10 | + mypy/typeshed/stdlib/time.pyi | 6 +++--- |
| 11 | + 3 files changed, 7 insertions(+), 7 deletions(-) |
10 | 12 |
|
| 13 | +diff --git a/mypy/typeshed/stdlib/dis.pyi b/mypy/typeshed/stdlib/dis.pyi |
| 14 | +index 984f932e3..a2831f11d 100644 |
| 15 | +--- a/mypy/typeshed/stdlib/dis.pyi |
| 16 | ++++ b/mypy/typeshed/stdlib/dis.pyi |
| 17 | +@@ -2,7 +2,7 @@ import sys |
| 18 | + import types |
| 19 | + from collections.abc import Callable, Iterator |
| 20 | + from opcode import * # `dis` re-exports it as a part of public API |
| 21 | +-from typing import IO, Any, Final, NamedTuple, TypeAlias, overload |
| 22 | ++from typing import IO, Any, Final, NamedTuple, Union, overload |
| 23 | + from typing_extensions import Self, deprecated, disjoint_base |
| 24 | + |
| 25 | + __all__ = [ |
| 26 | +@@ -41,7 +41,7 @@ else: |
| 27 | + |
| 28 | + # Strictly this should not have to include Callable, but mypy doesn't use FunctionType |
| 29 | + # for functions (python/mypy#3171) |
| 30 | +-_HaveCodeType: TypeAlias = types.MethodType | types.FunctionType | types.CodeType | type | Callable[..., Any] |
| 31 | ++_HaveCodeType = Union[types.MethodType, types.FunctionType, types.CodeType, type, Callable[..., Any]] |
| 32 | + |
| 33 | + if sys.version_info >= (3, 11): |
| 34 | + class Positions(NamedTuple): |
| 35 | +diff --git a/mypy/typeshed/stdlib/inspect.pyi b/mypy/typeshed/stdlib/inspect.pyi |
| 36 | +index cc39a7c9f..0ca4cff75 100644 |
| 37 | +--- a/mypy/typeshed/stdlib/inspect.pyi |
| 38 | ++++ b/mypy/typeshed/stdlib/inspect.pyi |
| 39 | +@@ -196,8 +196,8 @@ if sys.version_info >= (3, 14): |
| 40 | + |
| 41 | + modulesbyfile: dict[str, Any] |
| 42 | + |
| 43 | +-_GetMembersPredicateTypeGuard: TypeAlias = Callable[[Any], TypeGuard[_T]] |
| 44 | +-_GetMembersPredicateTypeIs: TypeAlias = Callable[[Any], TypeIs[_T]] |
| 45 | ++_GetMembersPredicateTypeGuard = Callable[[Any], TypeGuard[_T]] |
| 46 | ++_GetMembersPredicateTypeIs = Callable[[Any], TypeIs[_T]] |
| 47 | + _GetMembersPredicate: TypeAlias = Callable[[Any], bool] |
| 48 | + _GetMembersReturn: TypeAlias = list[tuple[str, _T]] |
| 49 | + |
11 | 50 | diff --git a/mypy/typeshed/stdlib/time.pyi b/mypy/typeshed/stdlib/time.pyi |
12 | 51 | index ac53089b8..9b5344b32 100644 |
13 | 52 | --- a/mypy/typeshed/stdlib/time.pyi |
|
0 commit comments