mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Improve traceback (#465)
This commit is contained in:
committed by
Guido van Rossum
parent
231ebbefaa
commit
4e55f0561f
@@ -5,7 +5,7 @@
|
||||
|
||||
from typing import (
|
||||
List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union,
|
||||
TypeVar, Callable
|
||||
TypeVar, Callable, Type,
|
||||
)
|
||||
from types import TracebackType
|
||||
|
||||
@@ -118,7 +118,7 @@ def displayhook(value: Optional[int]) -> None: ...
|
||||
def excepthook(type_: type, value: BaseException,
|
||||
traceback: TracebackType) -> None: ...
|
||||
# TODO should be a union of tuple, see mypy#1178
|
||||
def exc_info() -> Tuple[Optional[type],
|
||||
def exc_info() -> Tuple[Optional[Type[BaseException]],
|
||||
Optional[BaseException],
|
||||
Optional[TracebackType]]: ...
|
||||
# sys.exit() accepts an optional argument of anything printable
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
# Stubs for traceback
|
||||
|
||||
from typing import IO, List
|
||||
from types import TracebackType, FrameType
|
||||
import typing
|
||||
|
||||
# TODO signatures
|
||||
def format_exception_only(etype, value) -> List[str]: ...
|
||||
def format_exception(type: type, value: BaseException, tb: TracebackType, limit: int = ..., chain: bool = ...) -> List[str]: ...
|
||||
def format_tb(traceback): ...
|
||||
def print_exc(limit=..., file=..., chain=...): ...
|
||||
def format_exc(limit: int = ..., chain: bool = ...) -> str: ...
|
||||
def extract_stack(f=..., limit=...): ...
|
||||
def extract_tb(traceback, limit=...): ...
|
||||
def format_list(list): ...
|
||||
def format_stack(f=..., limit=...) -> List[str]: ...
|
||||
def print_stack(f: FrameType = ..., limit: int = ..., file: IO[str] = ...) -> None: ...
|
||||
|
||||
# TODO add more
|
||||
Reference in New Issue
Block a user