[Python-Dev] Re: __all__ for pickle

Skip Montanaro skip@mojam.com (Skip Montanaro)
Sat, 17 Feb 2001 09:29:34 -0600 (CST)


    Tim> I'm still not sure I've got any use for __all__, though <wink>.

That may be true.  I think the canonical case that is being defended against
is a module-level symbol in one module obscuring a builtin, e.g.:

    # a.py

    def list(s):
	return s

    # b.py

    from a import *
    ...
    l = list(('a','b','c'))

I suspect in the long-run there's a better way to accomplish this than
adding __all__ to most Python modules, perhaps pylint.

Which reminds me... I did write something once upon a time to catch symbols
that hide builtins, only at more than the module level:

    http://musi-cal.mojam.com/~skip/python/hiding.py

Skip