mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 06:36:54 +08:00
sys: Correct types of sys.displayhook, sys.excepthook and variants (#3673)
displayhook should accept any object, not just integers. displayhook and excepthook may be assigned to, so they should be Callable values rather than function definitions. That way it's fine to assign a function with different argument names. Their dunder variants are supposed to be constant.
This commit is contained in:
@@ -89,8 +89,8 @@ last_traceback: TracebackType
|
||||
meta_path: List[Any]
|
||||
path_hooks: List[Any]
|
||||
path_importer_cache: Dict[str, Any]
|
||||
displayhook: Optional[Callable[[int], None]]
|
||||
excepthook: Optional[Callable[[type, BaseException, TracebackType], None]]
|
||||
displayhook: Callable[[object], Any]
|
||||
excepthook: Callable[[Type[BaseException], BaseException, TracebackType], Any]
|
||||
exc_type: Optional[type]
|
||||
exc_value: Union[BaseException, ClassType]
|
||||
exc_traceback: TracebackType
|
||||
@@ -112,7 +112,7 @@ def _clear_type_cache() -> None: ...
|
||||
def _current_frames() -> Dict[int, FrameType]: ...
|
||||
def _getframe(depth: int = ...) -> FrameType: ...
|
||||
def call_tracing(fn: Any, args: Any) -> Any: ...
|
||||
def __displayhook__(value: int) -> None: ...
|
||||
def __displayhook__(value: object) -> None: ...
|
||||
def __excepthook__(type_: type, value: BaseException, traceback: TracebackType) -> None: ...
|
||||
def exc_clear() -> None: ...
|
||||
def exc_info() -> _OptExcInfo: ...
|
||||
|
||||
Reference in New Issue
Block a user