mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
allow instantiating TracebackType in 3.7 (#1967)
See https://docs.python.org/dev/reference/datamodel.html#traceback-objects and python/cpython#4793. part of #1965
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user