From e8bcb14f0957ef1fb829ab52054f64a6acfe5fa4 Mon Sep 17 00:00:00 2001 From: karl ding Date: Thu, 1 Oct 2020 08:38:11 -0700 Subject: [PATCH] tracemalloc: Add new functions from Python 3.9 (#4593) Add tracemalloc.reset_peak() --- stdlib/3/_tracemalloc.pyi | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdlib/3/_tracemalloc.pyi b/stdlib/3/_tracemalloc.pyi index 10e679783..4319ed46d 100644 --- a/stdlib/3/_tracemalloc.pyi +++ b/stdlib/3/_tracemalloc.pyi @@ -1,3 +1,4 @@ +import sys from tracemalloc import _FrameTupleT, _TraceTupleT from typing import Optional, Sequence, Tuple @@ -8,5 +9,9 @@ def get_traceback_limit() -> int: ... def get_traced_memory() -> Tuple[int, int]: ... def get_tracemalloc_memory() -> int: ... def is_tracing() -> bool: ... + +if sys.version_info >= (3, 9): + def reset_peak() -> None: ... + def start(__nframe: int = ...) -> None: ... def stop() -> None: ...