From 295788b67242af02c7a2ebdae7c888ee752be01f Mon Sep 17 00:00:00 2001 From: Andrey Vlasovskikh Date: Mon, 20 Feb 2017 22:50:14 +0300 Subject: [PATCH] Missing special attributes of class instances inherited from object (#943) * Missing special attributes of class instances inherited from object * object.__reduce__ returns a tuple It's up to its inheritors to return either a tuple or a string. --- stdlib/2/__builtin__.pyi | 3 +++ stdlib/3/builtins.pyi | 3 +++ 2 files changed, 6 insertions(+) diff --git a/stdlib/2/__builtin__.pyi b/stdlib/2/__builtin__.pyi index 94158b9a6..259c028c5 100644 --- a/stdlib/2/__builtin__.pyi +++ b/stdlib/2/__builtin__.pyi @@ -31,6 +31,7 @@ class object: __doc__ = ... # type: Optional[str] __class__ = ... # type: type __slots__ = ... # type: Optional[Union[str, unicode, Iterable[Union[str, unicode]]]] + __module__ = ... # type: str def __init__(self) -> None: ... def __new__(cls) -> Any: ... @@ -44,6 +45,8 @@ class object: def __getattribute__(self, name: str) -> Any: ... def __delattr__(self, name: str) -> None: ... def __sizeof__(self) -> int: ... + def __reduce__(self) -> tuple: ... + def __reduce_ex__(self, protocol: int) -> tuple: ... class type(object): __bases__ = ... # type: Tuple[type, ...] diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 377ae99b5..b0669b118 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -34,6 +34,7 @@ class object: __class__ = ... # type: type __dict__ = ... # type: Dict[str, Any] __slots__ = ... # type: Optional[Union[str, Iterable[str]]] + __module__ = ... # type: str def __init__(self) -> None: ... def __new__(cls) -> Any: ... @@ -47,6 +48,8 @@ class object: def __getattribute__(self, name: str) -> Any: ... def __delattr__(self, name: str) -> None: ... def __sizeof__(self) -> int: ... + def __reduce__(self) -> tuple: ... + def __reduce_ex__(self, protocol: int) -> tuple: ... if sys.version_info >= (3, 6): def __init_subclass__(cls) -> None: ...