RE: [Twisted-Python] python's "import" is giving me a headache.
![](https://secure.gravatar.com/avatar/133f14ed393c71118f82ce5ce235fbeb.jpg?s=120&d=mm&r=g)
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
![](https://secure.gravatar.com/avatar/e8d7e03b9981c937597d9bf9ef1f704b.jpg?s=120&d=mm&r=g)
On Wed, 2001-12-05 at 16:38, Juergen Hermann wrote:
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... [snip...]
Nothing in this is pretty in any way.
Well, I'm not opposed to evil, ugly hacks as long as they're only temporary. The only thing I'm worried about is pickle compatibility, source compatibility can be easily fixed. Everybody else: thoughts? -- -- Chris Armstrong <<< radix@twistedmatrix.com >>> http://twistedmatrix.com/users/carmstro.twistd/
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Chris Armstrong wrote:
Well, I'm not opposed to evil, ugly hacks as long as they're only temporary. The only thing I'm worried about is pickle compatibility, source compatibility can be easily fixed.
Everybody else: thoughts?
Write a utility to convert pickles?
![](https://secure.gravatar.com/avatar/433365de0f787faa3ed3e6dd1da5884f.jpg?s=120&d=mm&r=g)
Chris Armstrong wrote:
Well, I'm not opposed to evil, ugly hacks as long as they're only temporary. The only thing I'm worried about is pickle compatibility, source compatibility can be easily fixed.
Actually, I think there's some way ZODB can deal with classes changing modules. I'll do some checking...
participants (3)
-
Chris Armstrong
-
Itamar Shtull-Trauring
-
j.her@t-online.de