mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 04:04:25 +08:00
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:
@@ -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: ...
|
||||
|
||||
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user