wxPython - wx package (new style wxPython?)

David Bolen db3l at fitlinxx.com
Thu Dec 11 11:12:07 EST 2003


James Tanis <jtanis at charter.net> writes:

>         Bah, I think they are just over-glorifying the change. In my
> mind, it's the same exact thing. The only real different is when you
> "from wxPython.wx import *" it reads everything into your local
> namespace which is traditionally considered not the best thing to do. 
> I really have no idea if the "transition" when finished will remain
> backwards compatible, but I'm guessing from the description of the
> implementation that it is.

To be honest, for a while now I've often been doing:

    from wxPython import wx

and putting up with duplicated references to wx (e.g., wx.wxWindow).
That avoids both the pollution of the local namespace and the overhead
of pulling in the several thousand names (I got a noticeable
performance speed up in an application with many plugins since each
plugin no longer needed to make extra references for all the wx
objects in the plugin's local namespace).

One reason why I haven't moved to the new wx package yet is that it's
implemented as a lazy evaluation approach (probably for performance),
which means it doesn't play nice with interface tools that need
introspection (e.g., IDE completion) which some of my other developers
use.  Once wx becomes a full fledged normal module I'd definitely
consider moving to it for the same reasons that I use the above
approach now.

-- David




More information about the Python-list mailing list