Skip to content

Commit 1855bb9

Browse files
Sync typeshed (#17855)
Source commit: python/typeshed@91a58b0
1 parent 7dc23fe commit 1855bb9

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

mypy/typeshed/stdlib/cProfile.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import _lsprof
22
from _typeshed import StrOrBytesPath, Unused
3-
from collections.abc import Callable
3+
from collections.abc import Callable, Mapping
44
from types import CodeType
55
from typing import Any, TypeVar
66
from typing_extensions import ParamSpec, Self, TypeAlias
@@ -9,7 +9,7 @@ __all__ = ["run", "runctx", "Profile"]
99

1010
def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ...
1111
def runctx(
12-
statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = None, sort: str | int = -1
12+
statement: str, globals: dict[str, Any], locals: Mapping[str, Any], filename: str | None = None, sort: str | int = -1
1313
) -> None: ...
1414

1515
_T = TypeVar("_T")
@@ -23,7 +23,7 @@ class Profile(_lsprof.Profiler):
2323
def create_stats(self) -> None: ...
2424
def snapshot_stats(self) -> None: ...
2525
def run(self, cmd: str) -> Self: ...
26-
def runctx(self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
26+
def runctx(self, cmd: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> Self: ...
2727
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ...
2828
def __enter__(self) -> Self: ...
2929
def __exit__(self, *exc_info: Unused) -> None: ...

mypy/typeshed/stdlib/calendar.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ class Calendar:
7979
def monthdatescalendar(self, year: int, month: int) -> list[list[datetime.date]]: ...
8080
def monthdays2calendar(self, year: int, month: int) -> list[list[tuple[int, int]]]: ...
8181
def monthdayscalendar(self, year: int, month: int) -> list[list[int]]: ...
82-
def yeardatescalendar(self, year: int, width: int = 3) -> list[list[int]]: ...
83-
def yeardays2calendar(self, year: int, width: int = 3) -> list[list[tuple[int, int]]]: ...
84-
def yeardayscalendar(self, year: int, width: int = 3) -> list[list[int]]: ...
82+
def yeardatescalendar(self, year: int, width: int = 3) -> list[list[list[list[datetime.date]]]]: ...
83+
def yeardays2calendar(self, year: int, width: int = 3) -> list[list[list[list[tuple[int, int]]]]]: ...
84+
def yeardayscalendar(self, year: int, width: int = 3) -> list[list[list[list[int]]]]: ...
8585
def itermonthdays3(self, year: int, month: int) -> Iterable[tuple[int, int, int]]: ...
8686
def itermonthdays4(self, year: int, month: int) -> Iterable[tuple[int, int, int, int]]: ...
8787

mypy/typeshed/stdlib/profile.pyi

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from _typeshed import StrOrBytesPath
2-
from collections.abc import Callable
2+
from collections.abc import Callable, Mapping
33
from typing import Any, TypeVar
44
from typing_extensions import ParamSpec, Self, TypeAlias
55

66
__all__ = ["run", "runctx", "Profile"]
77

88
def run(statement: str, filename: str | None = None, sort: str | int = -1) -> None: ...
99
def runctx(
10-
statement: str, globals: dict[str, Any], locals: dict[str, Any], filename: str | None = None, sort: str | int = -1
10+
statement: str, globals: dict[str, Any], locals: Mapping[str, Any], filename: str | None = None, sort: str | int = -1
1111
) -> None: ...
1212

1313
_T = TypeVar("_T")
@@ -26,6 +26,6 @@ class Profile:
2626
def create_stats(self) -> None: ...
2727
def snapshot_stats(self) -> None: ...
2828
def run(self, cmd: str) -> Self: ...
29-
def runctx(self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ...
29+
def runctx(self, cmd: str, globals: dict[str, Any], locals: Mapping[str, Any]) -> Self: ...
3030
def runcall(self, func: Callable[_P, _T], /, *args: _P.args, **kw: _P.kwargs) -> _T: ...
3131
def calibrate(self, m: int, verbose: int = 0) -> float: ...

mypy/typeshed/stdlib/typing.pyi

+7-7
Original file line numberDiff line numberDiff line change
@@ -861,13 +861,13 @@ if sys.version_info >= (3, 9):
861861
def get_type_hints(
862862
obj: _get_type_hints_obj_allowed_types,
863863
globalns: dict[str, Any] | None = None,
864-
localns: dict[str, Any] | None = None,
864+
localns: Mapping[str, Any] | None = None,
865865
include_extras: bool = False,
866866
) -> dict[str, Any]: ...
867867

868868
else:
869869
def get_type_hints(
870-
obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: dict[str, Any] | None = None
870+
obj: _get_type_hints_obj_allowed_types, globalns: dict[str, Any] | None = None, localns: Mapping[str, Any] | None = None
871871
) -> dict[str, Any]: ...
872872

873873
def get_args(tp: Any) -> tuple[Any, ...]: ...
@@ -995,13 +995,13 @@ class ForwardRef:
995995
"that references a PEP 695 type parameter. It will be disallowed in Python 3.15."
996996
)
997997
def _evaluate(
998-
self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None, *, recursive_guard: frozenset[str]
998+
self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, *, recursive_guard: frozenset[str]
999999
) -> Any | None: ...
10001000
@overload
10011001
def _evaluate(
10021002
self,
10031003
globalns: dict[str, Any] | None,
1004-
localns: dict[str, Any] | None,
1004+
localns: Mapping[str, Any] | None,
10051005
type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...],
10061006
*,
10071007
recursive_guard: frozenset[str],
@@ -1010,17 +1010,17 @@ class ForwardRef:
10101010
def _evaluate(
10111011
self,
10121012
globalns: dict[str, Any] | None,
1013-
localns: dict[str, Any] | None,
1013+
localns: Mapping[str, Any] | None,
10141014
type_params: tuple[TypeVar | ParamSpec | TypeVarTuple, ...] | None = None,
10151015
*,
10161016
recursive_guard: frozenset[str],
10171017
) -> Any | None: ...
10181018
elif sys.version_info >= (3, 9):
10191019
def _evaluate(
1020-
self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None, recursive_guard: frozenset[str]
1020+
self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None, recursive_guard: frozenset[str]
10211021
) -> Any | None: ...
10221022
else:
1023-
def _evaluate(self, globalns: dict[str, Any] | None, localns: dict[str, Any] | None) -> Any | None: ...
1023+
def _evaluate(self, globalns: dict[str, Any] | None, localns: Mapping[str, Any] | None) -> Any | None: ...
10241024

10251025
def __eq__(self, other: object) -> bool: ...
10261026
def __hash__(self) -> int: ...

mypy/typeshed/stdlib/typing_extensions.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ OrderedDict = _Alias()
261261
def get_type_hints(
262262
obj: Callable[..., Any],
263263
globalns: dict[str, Any] | None = None,
264-
localns: dict[str, Any] | None = None,
264+
localns: Mapping[str, Any] | None = None,
265265
include_extras: bool = False,
266266
) -> dict[str, Any]: ...
267267
def get_args(tp: Any) -> tuple[Any, ...]: ...

0 commit comments

Comments
 (0)