From ff94f6def0206a41e2fbcb6d87c765197763f6d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Val=C3=A9rian=20Rousset?= Date: Mon, 30 May 2016 18:32:56 +0200 Subject: [PATCH] specifiy Callable in sys.call_tracing (#230) --- stdlib/3/sys.pyi | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/stdlib/3/sys.pyi b/stdlib/3/sys.pyi index e53320433..b3ba22aee 100644 --- a/stdlib/3/sys.pyi +++ b/stdlib/3/sys.pyi @@ -4,10 +4,13 @@ # based on http://docs.python.org/3.2/library/sys.html from typing import ( - List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union + List, Sequence, Any, Dict, Tuple, TextIO, overload, Optional, Union, + TypeVar, Callable ) from types import TracebackType +_T = TypeVar('_T') + # ----- sys variables ----- abiflags = ... # type: str argv = ... # type: List[str] @@ -108,7 +111,7 @@ version_info = ... # type: _version_info # ----- sys function stubs ----- -def call_tracing(fn: Any, args: Any) -> object: ... +def call_tracing(fn: Callable[..., _T], args: Any) -> _T: ... def _clear_type_cache() -> None: ... def _current_frames() -> Dict[int, Any]: ... def displayhook(value: Optional[int]) -> None: ...