diff --git a/stdlib/cProfile.pyi b/stdlib/cProfile.pyi index e5399beac..638a2a79f 100644 --- a/stdlib/cProfile.pyi +++ b/stdlib/cProfile.pyi @@ -1,6 +1,7 @@ import sys from _typeshed import AnyPath -from typing import Any, Callable, Dict, Optional, TypeVar, Union +from types import CodeType +from typing import Any, Callable, Dict, Optional, Tuple, TypeVar, Union def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... def runctx( @@ -9,8 +10,10 @@ def runctx( _SelfT = TypeVar("_SelfT", bound=Profile) _T = TypeVar("_T") +_Label = Tuple[str, int, str] class Profile: + stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented def __init__( self, timer: Callable[[], float] = ..., timeunit: float = ..., subcalls: bool = ..., builtins: bool = ... ) -> None: ... @@ -26,3 +29,5 @@ class Profile: if sys.version_info >= (3, 8): def __enter__(self: _SelfT) -> _SelfT: ... def __exit__(self, *exc_info: Any) -> None: ... + +def label(code: Union[str, CodeType]) -> _Label: ... # undocumented diff --git a/stdlib/profile.pyi b/stdlib/profile.pyi index d5f4bd4d5..cc769b604 100644 --- a/stdlib/profile.pyi +++ b/stdlib/profile.pyi @@ -1,5 +1,5 @@ from _typeshed import AnyPath -from typing import Any, Callable, Dict, Optional, TypeVar, Union +from typing import Any, Callable, Dict, Optional, Tuple, TypeVar, Union def run(statement: str, filename: Optional[str] = ..., sort: Union[str, int] = ...) -> None: ... def runctx( @@ -8,9 +8,11 @@ def runctx( _SelfT = TypeVar("_SelfT", bound=Profile) _T = TypeVar("_T") +_Label = Tuple[str, int, str] class Profile: bias: int + stats: dict[_Label, tuple[int, int, int, int, dict[_Label, tuple[int, int, int, int]]]] # undocumented def __init__(self, timer: Optional[Callable[[], float]] = ..., bias: Optional[int] = ...) -> None: ... def set_cmd(self, cmd: str) -> None: ... def simulate_call(self, name: str) -> None: ...