mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
tracemalloc: a number of fixes (#4078)
* tracemalloc.Frame: add __init__ * tracemalloc.Snapshot: add __init__ * tracemalloc.Snapshot: fix a staticmethod * tracemalloc.Statistic: add __init__ * tracemalloc.StatisticDiff: add __init__ * tracemalloc.Trace: add __init__ * tracemalloc.Traceback: add __init__ * tracemalloc: fix version availability, Trace __init__ * tracemalloc.Traceback: add total_nframe property * tracemalloc.Trace: add properties * tracemalloc.Traceback.format: add parameter * tracemalloc.start: make positional-only * tracemalloc.Filter: fix version availability * update whitelists Co-authored-by: hauntsaninja <>
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
@@ -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__
|
||||
|
||||
Reference in New Issue
Block a user