add object.__dir__ in Python 3 (#1532)

In Python 3 (but not Python 2), `object().__dir__()` works and returns a list of strings.

This is relevant when implementing a custom `__dir__` that invokes `super().__dir__()`.
This commit is contained in:
Jelle Zijlstra
2017-08-07 20:29:13 -06:00
committed by Guido van Rossum
parent 19275ea38a
commit d60f26c448

View File

@@ -50,6 +50,7 @@ class object:
def __sizeof__(self) -> int: ...
def __reduce__(self) -> tuple: ...
def __reduce_ex__(self, protocol: int) -> tuple: ...
def __dir__(self) -> List[str]: ...
if sys.version_info >= (3, 6):
def __init_subclass__(cls) -> None: ...