Skip to content

allow instantiating TracebackType in 3.7 #1967

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions stdlib/3/types.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,19 @@ class BuiltinFunctionType:
BuiltinMethodType = BuiltinFunctionType

class TracebackType:
tb_frame = ... # type: FrameType
tb_lasti = ... # type: int
tb_lineno = ... # type: int
tb_next = ... # type: TracebackType
if sys.version_info >= (3, 7):
def __init__(self, tb_next: Optional[TracebackType], tb_frame: FrameType, tb_lasti: int, tb_lineno: int) -> None: ...
tb_next: Optional[TracebackType]
else:
@property
def tb_next(self) -> Optional[TracebackType]: ...
# the rest are read-only even in 3.7
@property
def tb_frame(self) -> FrameType: ...
@property
def tb_lasti(self) -> int: ...
@property
def tb_lineno(self) -> int: ...

class FrameType:
f_back = ... # type: FrameType
Expand Down