On 02.08.20 15:36, Sebastian M. Ernst wrote:

Hi all,

yet another (possibly bad?) idea from day-to-day work ...

I occasionally need to import a lot of "stuff" from certain modules. The
"stuff" is usually following a pattern. E.g. I have modules that
(mostly) collect special exception classes and I usually need them all
in one push - but nothing else from those modules.

It seems the responsibility of the package / distribution you are using
to provide appropriate namespaces for their objects. If this "stuff" is
following a certain pattern it seems to be distinct from other parts of
the module, especially since you as a user have the need to only import
those objects. So if they lived in their own namespace then you could
simply do

    from somepkg.errors import *
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/G4VBY26AOYHF4WUCNDM73T5EPLMHBF2G/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to