Skip to content

Commit 295788b

Browse files
Andrey Vlasovskikhambv
authored andcommitted
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.
1 parent 8d42a28 commit 295788b

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

stdlib/2/__builtin__.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class object:
3131
__doc__ = ... # type: Optional[str]
3232
__class__ = ... # type: type
3333
__slots__ = ... # type: Optional[Union[str, unicode, Iterable[Union[str, unicode]]]]
34+
__module__ = ... # type: str
3435

3536
def __init__(self) -> None: ...
3637
def __new__(cls) -> Any: ...
@@ -44,6 +45,8 @@ class object:
4445
def __getattribute__(self, name: str) -> Any: ...
4546
def __delattr__(self, name: str) -> None: ...
4647
def __sizeof__(self) -> int: ...
48+
def __reduce__(self) -> tuple: ...
49+
def __reduce_ex__(self, protocol: int) -> tuple: ...
4750

4851
class type(object):
4952
__bases__ = ... # type: Tuple[type, ...]

stdlib/3/builtins.pyi

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class object:
3434
__class__ = ... # type: type
3535
__dict__ = ... # type: Dict[str, Any]
3636
__slots__ = ... # type: Optional[Union[str, Iterable[str]]]
37+
__module__ = ... # type: str
3738

3839
def __init__(self) -> None: ...
3940
def __new__(cls) -> Any: ...
@@ -47,6 +48,8 @@ class object:
4748
def __getattribute__(self, name: str) -> Any: ...
4849
def __delattr__(self, name: str) -> None: ...
4950
def __sizeof__(self) -> int: ...
51+
def __reduce__(self) -> tuple: ...
52+
def __reduce_ex__(self, protocol: int) -> tuple: ...
5053

5154
if sys.version_info >= (3, 6):
5255
def __init_subclass__(cls) -> None: ...

0 commit comments

Comments
 (0)