From 8502c8635fec3583a38123401db21a43484875d7 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 24 Jan 2022 00:17:16 +0300 Subject: [PATCH] Use `ParamSpec` for `bdb.Bdb.runcall` (#7006) --- stdlib/bdb.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stdlib/bdb.pyi b/stdlib/bdb.pyi index d32dd4468..8f61433e0 100644 --- a/stdlib/bdb.pyi +++ b/stdlib/bdb.pyi @@ -1,10 +1,11 @@ from types import CodeType, FrameType, TracebackType from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, TypeVar -from typing_extensions import Literal +from typing_extensions import Literal, ParamSpec __all__ = ["BdbQuit", "Bdb", "Breakpoint"] _T = TypeVar("_T") +_P = ParamSpec("_P") _TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type _ExcInfo = tuple[type[BaseException], BaseException, FrameType] @@ -64,7 +65,7 @@ class Bdb: def run(self, cmd: str | CodeType, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ... def runeval(self, expr: str, globals: dict[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...) -> None: ... def runctx(self, cmd: str | CodeType, globals: dict[str, Any] | None, locals: Mapping[str, Any] | None) -> None: ... - def runcall(self, __func: Callable[..., _T], *args: Any, **kwds: Any) -> _T | None: ... + def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ... class Breakpoint: