From d60f26c4484fee8993909c9136a98a8ced006fa8 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Mon, 7 Aug 2017 20:29:13 -0600 Subject: [PATCH] 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__()`. --- stdlib/3/builtins.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/3/builtins.pyi b/stdlib/3/builtins.pyi index 43b42bc97..4ac3cff86 100644 --- a/stdlib/3/builtins.pyi +++ b/stdlib/3/builtins.pyi @@ -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: ...