mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 20:24:30 +08:00
[traceback] Expose print_list method in traceback for python3. (#2837)
This commit is contained in:
committed by
Sebastian Rittau
parent
34cc5545fe
commit
5918098576
@@ -1,6 +1,6 @@
|
||||
# Stubs for traceback
|
||||
|
||||
from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Tuple, Type, Iterable
|
||||
from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Protocol, Tuple, Type, Iterable
|
||||
from types import FrameType, TracebackType
|
||||
import sys
|
||||
|
||||
@@ -36,6 +36,10 @@ if sys.version_info >= (3, 5):
|
||||
def extract_stack(f: Optional[FrameType] = ...,
|
||||
limit: Optional[int] = ...) -> StackSummary: ...
|
||||
def format_list(extracted_list: List[FrameSummary]) -> List[str]: ...
|
||||
class _Writer(Protocol):
|
||||
def write(self, s: str) -> Any: ...
|
||||
# undocumented
|
||||
def print_list(extracted_list: List[FrameSummary], file: Optional[_Writer] = ...) -> None: ...
|
||||
else:
|
||||
def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ...
|
||||
def extract_stack(f: Optional[FrameType] = ...,
|
||||
|
||||
Reference in New Issue
Block a user