[Twisted-Python] python's "import" is giving me a headache.

Juergen Hermann j.her at t-online.de
Wed Dec 5 16:38:54 EST 2001


On 05 Dec 2001 15:30:51 -0500, Chris Armstrong wrote:

>(well, you can, but you can't prevent all modules in a package from
>being imported).

Yes, you can, like...


__init__:

from tw.import import _delayedImport
oldname = _delayedImport('newname')


or even


sys.modules[__name__] = _delayedImporter(__name__,  
lookup_dict_with_old_names)


Nothing in this is pretty in any way.

Ciao, Jürgen







More information about the Twisted-Python mailing list