mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 21:14:48 +08:00
Backport many ParamSpec-related changes to Python 2 (#7054)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import types
|
||||
from _typeshed import StrPath
|
||||
from typing import Any, Callable, Mapping, Optional, Sequence, TypeVar
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
_T = TypeVar("_T")
|
||||
_P = ParamSpec("_P")
|
||||
_localtrace = Callable[[types.FrameType, str, Any], Callable[..., Any]]
|
||||
_fileModuleFunction = tuple[str, Optional[str], str]
|
||||
|
||||
@@ -38,7 +40,7 @@ class Trace:
|
||||
def runctx(
|
||||
self, cmd: str | types.CodeType, globals: Mapping[str, Any] | None = ..., locals: Mapping[str, Any] | None = ...
|
||||
) -> None: ...
|
||||
def runfunc(self, func: Callable[..., _T], *args: Any, **kw: Any) -> _T: ...
|
||||
def runfunc(self, func: Callable[_P, _T], *args: _P.args, **kw: _P.kwargs) -> _T: ...
|
||||
def file_module_function_of(self, frame: types.FrameType) -> _fileModuleFunction: ...
|
||||
def globaltrace_trackcallers(self, frame: types.FrameType, why: str, arg: Any) -> None: ...
|
||||
def globaltrace_countfuncs(self, frame: types.FrameType, why: str, arg: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user