Backport many ParamSpec-related changes to Python 2 (#7054)

This commit is contained in:
Alex Waygood
2022-01-27 15:57:26 +00:00
committed by GitHub
parent 5b39d07cd9
commit 2d8decd237
7 changed files with 21 additions and 8 deletions

View File

@@ -1,7 +1,9 @@
from types import CodeType, FrameType, TracebackType
from typing import IO, Any, Callable, Iterable, Mapping, SupportsInt, TypeVar
from typing_extensions import ParamSpec
_T = TypeVar("_T")
_P = ParamSpec("_P")
_TraceDispatch = Callable[[FrameType, str, Any], Any] # TODO: Recursive type
_ExcInfo = tuple[type[BaseException], BaseException, FrameType]
@@ -61,7 +63,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: