Unfortunately that is not the case. When you do a "from module import *",
it runs the code in the module (ie defines functions and classes, runs
functions called at the global level), and then imports all symbols not
starting with an underscore into the namespace of the module. So putting
the global function definitions into a separate module would not help. I
don't particularly want to break backward compatibility at the moment
either.
There is no way to tell if a module has been imported or with "import ..."
or "from ... import *" at initialisation time (and there shouldn't be --
why should the first import of a module be treated differently than
subsequent ones?).
James Henstridge.
--
Email: [EMAIL PROTECTED]
WWW: http://www.daa.com.au/~james/
On Mon, 22 Feb 1999, Aaron Optimizer Digulla wrote:
> Quoting James Henstridge <[EMAIL PROTECTED]>:
>
> > I think either using "from gtk import *" or "import gtk" are useful (they
> > are just different styles of python programming). I think I will leave
> > the Gtk prefix on the classes though, since it is used in all other GTK
> > language bindings I know of (perl, java, etc -- I know that the java
> > bindings decided on keeping the Gtk prefix even though all the classes
> > were in a gtk package).
> >
> > Anyway, calling constructors is only one part of a large program, so it is
> > not as if it is that much overhead.
>
> I myself wouldn't like to have to type gtk.GtkButton every time
> (I've never inhertied from a Gtk class, yet, so that would mean
> four keystrokes more for every usage of a Gtk-thing). But I agree
> that the namespace should not be cluttered unneccessarily. I'd
> propose to a) put all utility functions into a special class (so
> there would be only one name instead of several) or b) put all these
> functions into a module of their own which is imported by Gtk
> (the symbols which are imported by a module are not visible when
> the module is imported with "from module import *" AFAIK).
>
> --
> Aaron "Optimizer" Digulla Team AMIGA AROS Head of Development
> Author of XDME, ResTrackLib, CInt. <http://www.aros.org/>
> "(to) optimize: Make a program faster by improving the algorithms rather than
> by buying a faster machine." <[EMAIL PROTECTED]>
> To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]
>
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]