[Python-Dev] Matching __all__ to doc: bugfix or enhancement?

Eli Bendersky eliben at gmail.com
Fri Mar 15 02:54:34 CET 2013

On Thu, Mar 14, 2013 at 6:33 PM, Terry Reedy <tjreedy at udel.edu> wrote:

> The timeit doc describes four public attributes.
> The current timeit.__all__ only lists one.
> http://bugs.python.org/**issue17414 <http://bugs.python.org/issue17414>
> proposes to expand __all__ to include all four:
> -__all__ = ["Timer"]
> +__all__ = ["Timer", "timeit", "repeat", "default_timer"]
> The effect of the change is
> a) help(timit) will mention the three functions as well as the class;
> b) IDLE's attribute completion box* will list all four instead just Timer;
> c) unknow other users of .__all__ will see the expanded list, for better
> or worse.
Another effect is that existing code that does:

from timeit import *

May break. The above may not be the recommended best practice in Python,
but it's perfectly valid and widely used.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20130314/60b3f519/attachment.html>

More information about the Python-Dev mailing list