[Python-Dev] Dynamic module namspaces

Giovanni Bajo rasky at develer.com
Sat Jul 15 20:48:20 CEST 2006


Johan Dahlin wrote:

> My point is that I consider this to be a valid use case, the amount of
> saved memory is significan, and I could not find another way of doing
> it and still keep the gtk interface (import gtk; gtk.Button) to still be
> backwards compatible.

You may want to have a look at SIP/PyQt. They implement the full Qt
interface which is rather large, but import time is blazingly fast and
memory occupation grows only of 4-5 Mb at import-time. The trick is that
methods are "generated" dynamically at their first usage somehow (but dir()
and introspection still works...).

SIP is free and generic btw, you may want to consider it as a tool.
-- 
Giovanni Bajo



More information about the Python-Dev mailing list