mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 04:34:28 +08:00
traceback: Allow extracted_list params to be an Iterable containing tuples (#11675)
This commit is contained in:
@@ -27,7 +27,7 @@ __all__ = [
|
||||
"walk_tb",
|
||||
]
|
||||
|
||||
_PT: TypeAlias = tuple[str, int, str, str | None]
|
||||
_FrameSummaryTuple: TypeAlias = tuple[str, int, str, str | None]
|
||||
|
||||
def print_tb(tb: TracebackType | None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
|
||||
@@ -80,10 +80,10 @@ def print_last(limit: int | None = None, file: SupportsWrite[str] | None = None,
|
||||
def print_stack(f: FrameType | None = None, limit: int | None = None, file: SupportsWrite[str] | None = None) -> None: ...
|
||||
def extract_tb(tb: TracebackType | None, limit: int | None = None) -> StackSummary: ...
|
||||
def extract_stack(f: FrameType | None = None, limit: int | None = None) -> StackSummary: ...
|
||||
def format_list(extracted_list: list[FrameSummary]) -> list[str]: ...
|
||||
def format_list(extracted_list: Iterable[FrameSummary | _FrameSummaryTuple]) -> list[str]: ...
|
||||
|
||||
# undocumented
|
||||
def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = None) -> None: ...
|
||||
def print_list(extracted_list: Iterable[FrameSummary | _FrameSummaryTuple], file: SupportsWrite[str] | None = None) -> None: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
@overload
|
||||
@@ -255,7 +255,7 @@ class StackSummary(list[FrameSummary]):
|
||||
capture_locals: bool = False,
|
||||
) -> StackSummary: ...
|
||||
@classmethod
|
||||
def from_list(cls, a_list: Iterable[FrameSummary | _PT]) -> StackSummary: ...
|
||||
def from_list(cls, a_list: Iterable[FrameSummary | _FrameSummaryTuple]) -> StackSummary: ...
|
||||
if sys.version_info >= (3, 11):
|
||||
def format_frame_summary(self, frame_summary: FrameSummary) -> str: ...
|
||||
|
||||
|
||||
Reference in New Issue
Block a user