diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 6b1d178742e5..e0e512ba5e5c 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -30,13 +30,13 @@ class classmethod: pass # Special, only valid as a decorator. class object: __doc__ = ... # type: Optional[str] __class__ = ... # type: type + __dict__ = ... # type: Dict[str, Any] __slots__ = ... # type: Optional[Union[str, unicode, Iterable[Union[str, unicode]]]] + __module__ = ... # type: Any def __init__(self) -> None: ... def __new__(cls) -> Any: ... def __setattr__(self, name: str, value: Any) -> None: ... - def __eq__(self, o: object) -> bool: ... - def __ne__(self, o: object) -> bool: ... def __str__(self) -> str: ... def __repr__(self) -> str: ... def __hash__(self) -> int: ... @@ -44,12 +44,13 @@ class object: def __getattribute__(self, name: str) -> Any: ... def __delattr__(self, name: str) -> None: ... def __sizeof__(self) -> int: ... + def __reduce__(self) -> Union[str, unicode, tuple]: ... + def __reduce_ex__(self, protocol: int) -> Union[str, unicode, tuple]: ... class type(object): __bases__ = ... # type: Tuple[type, ...] __name__ = ... # type: str __module__ = ... # type: str - __dict__ = ... # type: Dict[unicode, Any] @overload def __init__(self, o: object) -> None: ... @@ -482,6 +483,8 @@ class tuple(Sequence[_T_co], Generic[_T_co]): def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __eq__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ne__(self, x: Tuple[_T_co, ...]) -> bool: ... def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... @@ -653,12 +656,11 @@ class xrange(Sized, Iterable[int], Reversible[int]): def __getitem__(self, i: int) -> int: ... def __reversed__(self) -> Iterator[int]: ... -class module: +class module(object): __name__ = ... # type: str __file__ = ... # type: str - __dict__ = ... # type: Dict[unicode, Any] -class property: +class property(object): def __init__(self, fget: Callable[[Any], Any] = None, fset: Callable[[Any, Any], None] = None, fdel: Callable[[Any], None] = None, doc: str = None) -> None: ... diff --git a/stdlib/2/types.pyi b/stdlib/2/types.pyi index 2f3b93549205..d325a202e502 100644 --- a/stdlib/2/types.pyi +++ b/stdlib/2/types.pyi @@ -28,7 +28,7 @@ DictType = DictionaryType = dict class _Cell: cell_contents = ... # type: Any -class FunctionType: +class FunctionType(object): func_closure = ... # type: Optional[Tuple[_Cell, ...]] func_code = ... # type: CodeType func_defaults = ... # type: Optional[Tuple[Any, ...]] @@ -39,7 +39,6 @@ class FunctionType: __closure__ = func_closure __code__ = func_code __defaults__ = func_defaults - __dict__ = func_dict __globals__ = func_globals __name__ = func_name def __call__(self, *args: Any, **kwargs: Any) -> Any: ... diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 7811b228c557..78d055363d9f 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -34,12 +34,11 @@ class object: __class__ = ... # type: type __dict__ = ... # type: Dict[str, Any] __slots__ = ... # type: Optional[Union[str, Iterable[str]]] + __module__ = ... # type: Any def __init__(self) -> None: ... def __new__(cls) -> Any: ... def __setattr__(self, name: str, value: Any) -> None: ... - def __eq__(self, o: object) -> bool: ... - def __ne__(self, o: object) -> bool: ... def __str__(self) -> str: ... def __repr__(self) -> str: ... def __hash__(self) -> int: ... @@ -47,6 +46,8 @@ class object: def __getattribute__(self, name: str) -> Any: ... def __delattr__(self, name: str) -> None: ... def __sizeof__(self) -> int: ... + def __reduce__(self) -> Union[str, tuple]: ... + def __reduce_ex__(self, protocol: int) -> Union[str, tuple]: ... if sys.version_info >= (3, 6): def __init_subclass__(cls) -> None: ... @@ -56,7 +57,6 @@ class type: __name__ = ... # type: str __qualname__ = ... # type: str __module__ = ... # type: str - __dict__ = ... # type: Dict[str, Any] __mro__ = ... # type: Tuple[type, ...] @overload @@ -499,6 +499,8 @@ class tuple(Sequence[_T_co], Generic[_T_co]): def __le__(self, x: Tuple[_T_co, ...]) -> bool: ... def __gt__(self, x: Tuple[_T_co, ...]) -> bool: ... def __ge__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __eq__(self, x: Tuple[_T_co, ...]) -> bool: ... + def __ne__(self, x: Tuple[_T_co, ...]) -> bool: ... def __add__(self, x: Tuple[_T_co, ...]) -> Tuple[_T_co, ...]: ... def __mul__(self, n: int) -> Tuple[_T_co, ...]: ... def __rmul__(self, n: int) -> Tuple[_T_co, ...]: ... @@ -673,11 +675,10 @@ class range(Sequence[int]): def __repr__(self) -> str: ... def __reversed__(self) -> Iterator[int]: ... -class module: +class module(object): # TODO not defined in builtins! __name__ = ... # type: str __file__ = ... # type: str - __dict__ = ... # type: Dict[str, Any] class property: def __init__(self, fget: Callable[[Any], Any] = None, diff --git a/stdlib/3/types.pyi b/stdlib/3/types.pyi index 17e33470a1c5..bdc3ce592438 100644 --- a/stdlib/3/types.pyi +++ b/stdlib/3/types.pyi @@ -24,7 +24,6 @@ class FunctionType: __closure__ = ... # type: Optional[Tuple[_Cell, ...]] __code__ = ... # type: CodeType __defaults__ = ... # type: Optional[Tuple[Any, ...]] - __dict__ = ... # type: Dict[str, Any] __globals__ = ... # type: Dict[str, Any] __name__ = ... # type: str def __call__(self, *args: Any, **kwargs: Any) -> Any: ...