<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 November 2017 at 22:27, Guido van Rossum <span dir="ltr"><<a href="mailto:guido@python.org" target="_blank">guido@python.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Picking up this thread as part of the PEP 562 and PEP 549 review. I like PEP 562 most, but I propose to add special-casing for `__dir__`. Not quite as proposed above (making the C level module_dir() look for `__all__`) but a bit more general -- making module_dir() look for `__dir__` and call that if present and callable. Ivan what do you think of that idea? It should be simple to add to your existing implementation. (<a href="https://github.com/ilevkivskyi/cpython/pull/3#issuecomment-343591293" target="_blank">https://github.com/<wbr>ilevkivskyi/cpython/pull/3#<wbr>issuecomment-343591293</a>)<br></div><div class="gmail_extra"><div><div class="h5"><br></div></div></div></blockquote><div></div><div><br></div><div>I like this idea. I was thinking about yet another option: *extending* the result of current dir() search by contents __all__ if present (not just returning contents of __all__).</div><div>But it looks like your idea covers more use cases, so I would stick with your idea.</div><div><br></div><div>--</div><div>Ivan</div><div><br></div><div><br></div></div></div></div>