[Python-ideas] PEP 562

Ivan Levkivskyi levkivskyi at gmail.com
Fri Nov 10 16:51:47 EST 2017

On 10 November 2017 at 22:27, Guido van Rossum <guido at python.org> wrote:

> 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. (https://github.com/
> ilevkivskyi/cpython/pull/3#issuecomment-343591293)
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__).
But it looks like your idea covers more use cases, so I would stick with
your idea.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20171110/4aea341c/attachment.html>

More information about the Python-ideas mailing list