diff --git a/stdlib/3/tracemalloc.pyi b/stdlib/3/tracemalloc.pyi index 8758cc670..e09dccce6 100644 --- a/stdlib/3/tracemalloc.pyi +++ b/stdlib/3/tracemalloc.pyi @@ -9,7 +9,7 @@ def get_traceback_limit() -> int: ... def get_traced_memory() -> Tuple[int, int]: ... def get_tracemalloc_memory() -> int: ... def is_tracing() -> bool: ... -def start(nframe: int = ...) -> None: ... +def start(__nframe: int = ...) -> None: ... def stop() -> None: ... def take_snapshot() -> Snapshot: ... @@ -26,21 +26,26 @@ class Filter: lineno: Optional[int] filename_pattern: str all_frames: bool - def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ..., domain: Optional[int] = ...) -> None: ... + if sys.version_info >= (3, 6): + def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ..., domain: Optional[int] = ...) -> None: ... + else: + def __init__(self, inclusive: bool, filename_pattern: str, lineno: Optional[int] = ..., all_frames: bool = ...) -> None: ... class Frame: filename: str lineno: int + def __init__(self, frame: Tuple[str, int]) -> None: ... class Snapshot: + def __init__(self, traces: Tuple[Tuple[str, int], ...], traceback_limit: int) -> None: ... def compare_to(self, old_snapshot: Snapshot, key_type: str, cumulative: bool = ...) -> List[StatisticDiff]: ... def dump(self, filename: str) -> None: ... if sys.version_info >= (3, 6): def filter_traces(self, filters: Sequence[Union[DomainFilter, Filter]]) -> Snapshot: ... else: def filter_traces(self, filters: Sequence[Filter]) -> Snapshot: ... - @classmethod - def load(cls, filename: str) -> Snapshot: ... + @staticmethod + def load(filename: str) -> Snapshot: ... def statistics(self, key_type: str, cumulative: bool = ...) -> List[Statistic]: ... traceback_limit: int traces: Sequence[Trace] @@ -49,6 +54,7 @@ class Statistic: count: int size: int traceback: Traceback + def __init__(self, traceback: Traceback, size: int, count: int) -> None: ... class StatisticDiff: count: int @@ -56,13 +62,27 @@ class StatisticDiff: size: int size_diff: int traceback: Traceback + def __init__(self, traceback: Traceback, size: int, size_diff: int, count: int, count_diff: int) -> None: ... class Trace: + domain: int size: int traceback: Traceback + if sys.version_info >= (3, 9): + def __init__(self, trace: Union[Tuple[int, int, Tuple[Tuple[str, int], ...], Optional[int]], Tuple[int, int, Tuple[Tuple[str, int], ...]]]) -> None: ... + else: + def __init__(self, trace: Tuple[int, int, Tuple[Tuple[str, int], ...]]) -> None: ... class Traceback(Sequence[Frame]): - def format(self, limit: Optional[int] = ...) -> List[str]: ... + if sys.version_info >= (3, 9): + total_nframe: Optional[int] + def __init__(self, frames: Tuple[Tuple[str, int], ...], total_nframe: Optional[int] = ...) -> None: ... + else: + def __init__(self, frames: Tuple[Tuple[str, int], ...]) -> None: ... + if sys.version_info >= (3, 7): + def format(self, limit: Optional[int] = ..., most_recent_first: bool = ...) -> List[str]: ... + else: + def format(self, limit: Optional[int] = ...) -> List[str]: ... @overload def __getitem__(self, i: int) -> Frame: ... @overload diff --git a/tests/stubtest_whitelists/py35.txt b/tests/stubtest_whitelists/py35.txt index 844f9c827..e2d141036 100644 --- a/tests/stubtest_whitelists/py35.txt +++ b/tests/stubtest_whitelists/py35.txt @@ -50,7 +50,6 @@ smtpd.SMTPChannel.__init__ smtpd.SMTPServer.__init__ socket.NETLINK_CRYPTO sre_compile.dis -tracemalloc.Filter.__init__ typing.AbstractSet.isdisjoint typing.Coroutine.cr_await typing.Coroutine.cr_code diff --git a/tests/stubtest_whitelists/py37.txt b/tests/stubtest_whitelists/py37.txt index 2e796baad..d37f7d282 100644 --- a/tests/stubtest_whitelists/py37.txt +++ b/tests/stubtest_whitelists/py37.txt @@ -56,7 +56,6 @@ time.CLOCK_PROF time.CLOCK_UPTIME tkinter.Menu.tk_bindForTraversal tkinter.Misc.tk_menuBar -tracemalloc.Traceback.format types.ClassMethodDescriptorType.__get__ types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ diff --git a/tests/stubtest_whitelists/py38.txt b/tests/stubtest_whitelists/py38.txt index bc2b50877..e31f5724e 100644 --- a/tests/stubtest_whitelists/py38.txt +++ b/tests/stubtest_whitelists/py38.txt @@ -134,8 +134,6 @@ time.CLOCK_UPTIME tkinter.Menu.tk_bindForTraversal tkinter.Misc.tk_menuBar trace.Trace.runfunc -tracemalloc.Traceback.format -tracemalloc.start types.ClassMethodDescriptorType.__get__ types.CodeType.replace types.MethodDescriptorType.__get__ diff --git a/tests/stubtest_whitelists/py3_common.txt b/tests/stubtest_whitelists/py3_common.txt index 423000885..53f9b0539 100644 --- a/tests/stubtest_whitelists/py3_common.txt +++ b/tests/stubtest_whitelists/py3_common.txt @@ -459,7 +459,6 @@ timeit.main traceback.FrameSummary.__init__ traceback.TracebackException.__init__ traceback.TracebackException.from_exception -tracemalloc.Snapshot.load types.GetSetDescriptorType.__get__ types.GetSetDescriptorType.__set__ types.MemberDescriptorType.__get__