Skip to content

Commit 5918098

Browse files
lic9srittau
authored andcommitted
[traceback] Expose print_list method in traceback for python3. (#2837)
1 parent 34cc554 commit 5918098

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

stdlib/2and3/traceback.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Stubs for traceback
22

3-
from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Tuple, Type, Iterable
3+
from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable
44
from types import FrameType, TracebackType
55
import sys
66

@@ -36,6 +36,10 @@ if sys.version_info >= (3, 5):
3636
def extract_stack(f: Optional[FrameType] = ...,
3737
limit: Optional[int] = ...) -> StackSummary: ...
3838
def format_list(extracted_list: List[FrameSummary]) -> List[str]: ...
39+
class _Writer(Protocol):
40+
def write(self, s: str) -> Any: ...
41+
# undocumented
42+
def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ...
3943
else:
4044
def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ...
4145
def extract_stack(f: Optional[FrameType] = ...,

0 commit comments

Comments
 (0)