Class optimization at runtime

Dan Sommers me at privacy.net
Mon Aug 9 19:00:56 CEST 2004


On 9 Aug 2004 06:59:47 -0700,
gry at ll.mit.edu (george young) wrote:

> How about the pygtk style "require":
>     import pygtk
>     pygtk.require('2.0')
>     import gtk # uses state set by the "require" call.

> This always seems a clean interface to me.  Much safer and cleaner
> than something peeking at a global (or environment) variable.

Our mileage has varied.  That one always seemed very unclean to me.

In my mind, pygtk sits on top of gtk, and that interface requires gtk to
look "up" to figure out what to do.  Nothing inside gtk should depend on
(or even know about) anything inside pygtk.

Regards,
Dan

-- 
Dan Sommers
<http://www.tombstonezero.net/dan/>
Never play leapfrog with a unicorn.



More information about the Python-list mailing list