From f73351f5bfbb0d994358bda861bfdea6ad8de713 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 11 Jun 2018 14:01:46 -0700 Subject: [PATCH] make tracemalloc.Traceback instantiable (#2117) --- stdlib/3.4/tracemalloc.pyi | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/stdlib/3.4/tracemalloc.pyi b/stdlib/3.4/tracemalloc.pyi index 57b8f6cd3..f1b69cded 100644 --- a/stdlib/3.4/tracemalloc.pyi +++ b/stdlib/3.4/tracemalloc.pyi @@ -1,7 +1,7 @@ # Stubs for tracemalloc (Python 3.4+) import sys -from typing import Any, List, Optional, Sequence, Tuple, Union +from typing import Any, List, Optional, Sequence, Tuple, Union, overload def clear_traces() -> None: ... def get_object_traceback(obj: object) -> Optional[Traceback]: ... @@ -63,3 +63,8 @@ class Trace: class Traceback(Sequence[Frame]): def format(self, limit: Optional[int] = ...) -> List[str]: ... + @overload + def __getitem__(self, i: int) -> Frame: ... + @overload + def __getitem__(self, s: slice) -> Sequence[Frame]: ... + def __len__(self) -> int: ...