[Python-Dev] Add __exports__ to modules

M.-A. Lemburg mal@lemburg.com
Mon, 08 Jan 2001 16:52:32 +0100


Moshe Zadka wrote:
> 
> On Mon, 08 Jan 2001 09:33:09 -0500, Guido van Rossum <guido@python.org> wrote:
> > > hehe... adding __exports__ to your module is fine. Adding more crud to
> > > Python, in opposition to the "we're all adults" motto, doesn't seem Right.
> > >
> > > Somebody wants to use "from foo import *" on a module not designed for it?
> > > Too bad for them. If you're suggesting __exports__ is to patch over problems
> > > caused by "from foo import *", then I think you're barking up the wrong tree
> > > :-)
> >
> > You haven't been answering many newbie questions lately, have you? :-)
> 
> Well, I have.
> And frankly, I think having "from foo import *" issue a warning at 2.1
> a *much* better solution.

Why raise a warning ? "from xyz import *" is still very useful in
intercative sessions and also has some merrits when it comes to
importing all subpackages of a package (well, at least those listed
in __all__).

-- 
Marc-Andre Lemburg
______________________________________________________________________
Company:                                        http://www.egenix.com/
Consulting:                                    http://www.lemburg.com/
Python Pages:                           http://www.lemburg.com/python/