From 3319cadf85012328f8a12b15da4eecc8de0cf305 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 19 May 2019 00:14:39 +0200 Subject: [PATCH] Make builtins work One change is a Jedi issue, Jedi cannot really deal with __new__. The other is a typeshed issue. "function" should not be defined in the stubs. --- stdlib/2/__builtin__.pyi | 10 +--------- stdlib/2and3/builtins.pyi | 10 +--------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 13a6ef968..cca0e4f07 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -852,6 +852,7 @@ class slice(object): 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] = ...): ... def __len__(self) -> int: ... def __contains__(self, x: object) -> bool: ... @overload @@ -872,15 +873,6 @@ class tuple(Sequence[_T_co], Generic[_T_co]): else: def index(self, x: Any) -> int: ... -class function: - # TODO not defined in builtins! - __name__: str - __module__: str - if sys.version_info >= (3,): - __qualname__: str - __code__: CodeType - __annotations__: Dict[str, Any] - class list(MutableSequence[_T], Generic[_T]): @overload def __init__(self) -> None: ... diff --git a/stdlib/2and3/builtins.pyi b/stdlib/2and3/builtins.pyi index 13a6ef968..cca0e4f07 100644 --- a/stdlib/2and3/builtins.pyi +++ b/stdlib/2and3/builtins.pyi @@ -852,6 +852,7 @@ class slice(object): 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] = ...): ... def __len__(self) -> int: ... def __contains__(self, x: object) -> bool: ... @overload @@ -872,15 +873,6 @@ class tuple(Sequence[_T_co], Generic[_T_co]): else: def index(self, x: Any) -> int: ... -class function: - # TODO not defined in builtins! - __name__: str - __module__: str - if sys.version_info >= (3,): - __qualname__: str - __code__: CodeType - __annotations__: Dict[str, Any] - class list(MutableSequence[_T], Generic[_T]): @overload def __init__(self) -> None: ...