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.
This commit is contained in:
Dave Halter
2019-05-19 00:14:39 +02:00
parent 772f7a48e6
commit d386452478
2 changed files with 2 additions and 18 deletions

View File

@@ -869,6 +869,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
@@ -892,15 +893,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
__code__: CodeType
if sys.version_info >= (3,):
__qualname__: str
__annotations__: Dict[str, Any]
class list(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self) -> None: ...

View File

@@ -869,6 +869,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
@@ -892,15 +893,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
__code__: CodeType
if sys.version_info >= (3,):
__qualname__: str
__annotations__: Dict[str, Any]
class list(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self) -> None: ...