From 7dbb7832ad5ef29a9f79079beb09556ecf269c8b Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 13 Mar 2017 14:08:50 +0100 Subject: [PATCH 1/2] Add __annotations__ to Python 3 --- stdlib/3/builtins.pyi | 3 +++ 1 file changed, 3 insertions(+) diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 994720c32fcf..1ed740dac5cb 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -35,6 +35,8 @@ class object: __dict__ = ... # type: Dict[str, Any] __slots__ = ... # type: Optional[Union[str, Iterable[str]]] __module__ = ... # type: str + if sys.version_info >= (3, 6): + __annotations__ = ... # type: Dict[str, Any] def __init__(self) -> None: ... def __new__(cls) -> Any: ... @@ -552,6 +554,7 @@ class function: __qualname__ = ... # type: str __module__ = ... # type: str __code__ = ... # type: Any + __annotations__ = ... # type: Dict[str, Any] class list(MutableSequence[_T], Generic[_T]): @overload From c14c1582bf14314a352eb3f91ccb133f79b6e31d Mon Sep 17 00:00:00 2001 From: Ivan Levkivskyi Date: Mon, 13 Mar 2017 14:16:08 +0100 Subject: [PATCH 2/2] Fix lint --- stdlib/3/builtins.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 1ed740dac5cb..ef6e29410b5b 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -36,7 +36,7 @@ class object: __slots__ = ... # type: Optional[Union[str, Iterable[str]]] __module__ = ... # type: str if sys.version_info >= (3, 6): - __annotations__ = ... # type: Dict[str, Any] + __annotations__ = ... # type: Dict[str, Any] def __init__(self) -> None: ... def __new__(cls) -> Any: ... @@ -554,7 +554,7 @@ class function: __qualname__ = ... # type: str __module__ = ... # type: str __code__ = ... # type: Any - __annotations__ = ... # type: Dict[str, Any] + __annotations__ = ... # type: Dict[str, Any] class list(MutableSequence[_T], Generic[_T]): @overload