__all__ attribute: bug and proposal

Random832 random832 at fastmail.com
Mon Jun 27 22:27:21 EDT 2016


On Mon, Jun 27, 2016, at 20:32, Chris Angelico wrote:
> If you're primarily worried about classes and functions, here's a neat
> trick you can use:

How about just

__all__ = [list of stuff including classes and functions]
__all__ = [x if isinstance(x, str) else x.__name__ for x in __all__]



More information about the Python-list mailing list