add _lsprof module (#11159)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
Stephen Morton
2024-02-16 08:38:49 -08:00
committed by GitHub
parent f3c7c48438
commit 764532356a
4 changed files with 39 additions and 6 deletions

View File

@@ -1,3 +1,4 @@
import _lsprof
from _typeshed import StrOrBytesPath, Unused
from collections.abc import Callable
from types import CodeType
@@ -15,13 +16,8 @@ _T = TypeVar("_T")
_P = ParamSpec("_P")
_Label: TypeAlias = tuple[str, int, str]
class Profile:
class Profile(_lsprof.Profiler):
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: ...
def enable(self) -> None: ...
def disable(self) -> None: ...
def print_stats(self, sort: str | int = -1) -> None: ...
def dump_stats(self, file: StrOrBytesPath) -> None: ...
def create_stats(self) -> None: ...