From d4c15011e45ab1ca6e7db2b8c080353186b00449 Mon Sep 17 00:00:00 2001 From: Steven Karas Date: Tue, 3 Jul 2018 18:18:01 +0300 Subject: [PATCH] add __new__ to tuple in python2 (#2304) this solves #2091 when checking Python 2 code (#2092 only fixed it for Python 3). --- stdlib/2/__builtin__.pyi | 1 + stdlib/2/builtins.pyi | 1 + 2 files changed, 2 insertions(+) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index ffb8f14b8..5a46deb80 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -515,6 +515,7 @@ class slice(object): def indices(self, len: int) -> Tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... def __len__(self) -> int: ... def __contains__(self, x: object) -> bool: ... diff --git a/stdlib/2/builtins.pyi b/stdlib/2/builtins.pyi index ffb8f14b8..5a46deb80 100644 --- a/stdlib/2/builtins.pyi +++ b/stdlib/2/builtins.pyi @@ -515,6 +515,7 @@ class slice(object): def indices(self, len: int) -> Tuple[int, int, int]: ... class tuple(Sequence[_T_co], Generic[_T_co]): + def __new__(cls: Type[_T], iterable: Iterable[_T_co] = ...) -> _T: ... def __init__(self, iterable: Iterable[_T_co] = ...) -> None: ... def __len__(self) -> int: ... def __contains__(self, x: object) -> bool: ...