forked from python/typeshed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtraceback.pyi
More file actions
191 lines (178 loc) · 6.52 KB
/
Copy pathtraceback.pyi
File metadata and controls
191 lines (178 loc) · 6.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import sys
from _typeshed import Self, SupportsWrite
from types import FrameType, TracebackType
from typing import IO, Any, Generator, Iterable, Iterator, Mapping, Optional, overload
from typing_extensions import Literal
_PT = tuple[str, int, str, Optional[str]]
def print_tb(tb: TracebackType | None, limit: int | None = ..., file: IO[str] | None = ...) -> None: ...
if sys.version_info >= (3, 10):
@overload
def print_exception(
__exc: type[BaseException] | None,
value: BaseException | None = ...,
tb: TracebackType | None = ...,
limit: int | None = ...,
file: IO[str] | None = ...,
chain: bool = ...,
) -> None: ...
@overload
def print_exception(
__exc: BaseException, *, limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...
) -> None: ...
@overload
def format_exception(
__exc: type[BaseException] | None,
value: BaseException | None = ...,
tb: TracebackType | None = ...,
limit: int | None = ...,
chain: bool = ...,
) -> list[str]: ...
@overload
def format_exception(__exc: BaseException, *, limit: int | None = ..., chain: bool = ...) -> list[str]: ...
else:
def print_exception(
etype: type[BaseException] | None,
value: BaseException | None,
tb: TracebackType | None,
limit: int | None = ...,
file: IO[str] | None = ...,
chain: bool = ...,
) -> None: ...
def format_exception(
etype: type[BaseException] | None,
value: BaseException | None,
tb: TracebackType | None,
limit: int | None = ...,
chain: bool = ...,
) -> list[str]: ...
def print_exc(limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...) -> None: ...
def print_last(limit: int | None = ..., file: IO[str] | None = ..., chain: bool = ...) -> None: ...
def print_stack(f: FrameType | None = ..., limit: int | None = ..., file: IO[str] | None = ...) -> None: ...
def extract_tb(tb: TracebackType | None, limit: int | None = ...) -> StackSummary: ...
def extract_stack(f: FrameType | None = ..., limit: int | None = ...) -> StackSummary: ...
def format_list(extracted_list: list[FrameSummary]) -> list[str]: ...
# undocumented
def print_list(extracted_list: list[FrameSummary], file: SupportsWrite[str] | None = ...) -> None: ...
if sys.version_info >= (3, 10):
def format_exception_only(__exc: type[BaseException] | None, value: BaseException | None = ...) -> list[str]: ...
else:
def format_exception_only(etype: type[BaseException] | None, value: BaseException | None) -> list[str]: ...
def format_exc(limit: int | None = ..., chain: bool = ...) -> str: ...
def format_tb(tb: TracebackType | None, limit: int | None = ...) -> list[str]: ...
def format_stack(f: FrameType | None = ..., limit: int | None = ...) -> list[str]: ...
def clear_frames(tb: TracebackType) -> None: ...
def walk_stack(f: FrameType | None) -> Iterator[tuple[FrameType, int]]: ...
def walk_tb(tb: TracebackType | None) -> Iterator[tuple[FrameType, int]]: ...
class TracebackException:
__cause__: TracebackException
__context__: TracebackException
__suppress_context__: bool
stack: StackSummary
exc_type: type[BaseException]
filename: str
lineno: int
text: str
offset: int
msg: str
if sys.version_info >= (3, 10):
def __init__(
self,
exc_type: type[BaseException],
exc_value: BaseException,
exc_traceback: TracebackType | None,
*,
limit: int | None = ...,
lookup_lines: bool = ...,
capture_locals: bool = ...,
compact: bool = ...,
_seen: set[int] | None = ...,
) -> None: ...
@classmethod
def from_exception(
cls: type[Self],
exc: BaseException,
*,
limit: int | None = ...,
lookup_lines: bool = ...,
capture_locals: bool = ...,
compact: bool = ...,
) -> Self: ...
else:
def __init__(
self,
exc_type: type[BaseException],
exc_value: BaseException,
exc_traceback: TracebackType | None,
*,
limit: int | None = ...,
lookup_lines: bool = ...,
capture_locals: bool = ...,
_seen: set[int] | None = ...,
) -> None: ...
@classmethod
def from_exception(
cls: type[Self], exc: BaseException, *, limit: int | None = ..., lookup_lines: bool = ..., capture_locals: bool = ...
) -> Self: ...
def format(self, *, chain: bool = ...) -> Generator[str, None, None]: ...
def format_exception_only(self) -> Generator[str, None, None]: ...
class FrameSummary(Iterable[Any]):
if sys.version_info >= (3, 11):
def __init__(
self,
filename: str,
lineno: int | None,
name: str,
*,
lookup_line: bool = ...,
locals: Mapping[str, str] | None = ...,
line: str | None = ...,
end_lineno: int | None = ...,
colno: int | None = ...,
end_colno: int | None = ...,
) -> None: ...
end_lineno: int | None
colno: int | None
end_colno: int | None
else:
def __init__(
self,
filename: str,
lineno: int | None,
name: str,
*,
lookup_line: bool = ...,
locals: Mapping[str, str] | None = ...,
line: str | None = ...,
) -> None: ...
filename: str
lineno: int | None
name: str
locals: dict[str, str] | None
@property
def line(self) -> str | None: ...
@overload
def __getitem__(self, i: Literal[0]) -> str: ...
@overload
def __getitem__(self, i: Literal[1]) -> int: ...
@overload
def __getitem__(self, i: Literal[2]) -> str: ...
@overload
def __getitem__(self, i: Literal[3]) -> str | None: ...
@overload
def __getitem__(self, i: int) -> Any: ...
def __iter__(self) -> Iterator[Any]: ...
if sys.version_info >= (3, 8):
def __len__(self) -> Literal[4]: ...
class StackSummary(list[FrameSummary]):
@classmethod
def extract(
cls,
frame_gen: Iterable[tuple[FrameType, int]],
*,
limit: int | None = ...,
lookup_lines: bool = ...,
capture_locals: bool = ...,
) -> StackSummary: ...
@classmethod
def from_list(cls, a_list: list[_PT]) -> StackSummary: ...
def format(self) -> list[str]: ...