On Tue, Jun 28, 2016 at 6:56 AM, Pavel S <pa...@schon.cz> wrote:
> Porposal: allow putting objects into __all__ directly, so possible problems 
> will be found earlier:
>
> # module foo.py
> class A: pass
> class B: pass
> class C: pass
>
> __all__ = (A, B, C)
>
> Note: this currently don't work.
>
>>>> from foo import *
> TypeError: attribute name must be string, not 'type'

How would it know what names to import them under? It's all very well
with classes and functions (you could mandate that it uses the
canonical name), but what about integers or strings?

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to