From 166d6c618c01af2dc44e9d53465bdd1d017c04dd Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 24 Jan 2022 00:34:40 +0300 Subject: [PATCH] Use `ParamSpec` in `profile.Profile.runcall` (#7010) --- stdlib/profile.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/profile.pyi b/stdlib/profile.pyi index 007a1a11d..b9afcbcae 100644 --- a/stdlib/profile.pyi +++ b/stdlib/profile.pyi @@ -1,5 +1,6 @@ from _typeshed import Self, StrOrBytesPath from typing import Any, Callable, TypeVar +from typing_extensions import ParamSpec def run(statement: str, filename: str | None = ..., sort: str | int = ...) -> None: ... def runctx( @@ -7,6 +8,7 @@ def runctx( ) -> None: ... _T = TypeVar("_T") +_P = ParamSpec("_P") _Label = tuple[str, int, str] class Profile: @@ -22,5 +24,5 @@ class Profile: def snapshot_stats(self) -> None: ... def run(self: Self, cmd: str) -> Self: ... def runctx(self: Self, cmd: str, globals: dict[str, Any], locals: dict[str, Any]) -> Self: ... - def runcall(self, __func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ... + def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ... def calibrate(self, m: int, verbose: int = ...) -> float: ...