__all__ attribute: bug and proposal

MRAB python at mrabarnett.plus.com
Mon Jun 27 21:55:46 EDT 2016


On 2016-06-28 01:32, Chris Angelico wrote:
[snip]

> If you're primarily worried about classes and functions, here's a neat
> trick you can use:
>
> __all__ = []
> def all(thing):
>     __all__.append(thing.__name__)
>     return thing
>
Err... won't that hide the 'all' builtin?




More information about the Python-list mailing list