|
1 | 1 | # Stubs for traceback |
2 | 2 |
|
3 | | -from typing import Any, Dict, Generator, IO, Iterator, List, Mapping, Optional, Tuple, Type, Iterable |
| 3 | +from typing import Any, Dict, Generator, IO, Iterable, Iterator, List, Mapping, Optional, Tuple, Type, Union |
4 | 4 | from types import FrameType, TracebackType |
5 | 5 | import sys |
6 | 6 |
|
@@ -35,6 +35,8 @@ if sys.version_info >= (3, 5): |
35 | 35 | def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> StackSummary: ... |
36 | 36 | def extract_stack(f: Optional[FrameType] = ..., |
37 | 37 | limit: Optional[int] = ...) -> StackSummary: ... |
| 38 | + # TODO(https://bugs.python.org/issue34648): relax the type of |
| 39 | + # extracted_list to Iterable[FrameSummary]. |
38 | 40 | def format_list(extracted_list: List[FrameSummary]) -> List[str]: ... |
39 | 41 | else: |
40 | 42 | def extract_tb(tb: Optional[TracebackType], limit: Optional[int] = ...) -> List[_PT]: ... |
@@ -111,6 +113,9 @@ if sys.version_info >= (3, 5): |
111 | 113 | frame_gen: Generator[Tuple[FrameType, int], None, None], |
112 | 114 | *, limit: Optional[int] = ..., lookup_lines: bool = ..., |
113 | 115 | capture_locals: bool = ...) -> StackSummary: ... |
| 116 | + # TODO(https://bugs.python.org/issue34648): relax "a_list" to |
| 117 | + # Iterable[Union[_PT, FrameSummary]]... and then at some later point |
| 118 | + # drop support for _PT. |
114 | 119 | @classmethod |
115 | | - def from_list(cls, a_list: List[_PT]) -> StackSummary: ... |
| 120 | + def from_list(cls, a_list: List[Union[_PT, FrameSummary]]) -> StackSummary: ... |
116 | 121 | def format(self) -> List[str]: ... |
0 commit comments