Package that imports with name of dependent package

Maric Michaud maric at
Sat May 13 17:32:12 CEST 2006

Le Samedi 13 Mai 2006 16:05, David Pratt a écrit :
> I'd appreciate hearing of what I can do in an __init__ file or what
> other strategy could make this work. Many thanks.
you should leave the original package intact and patch it with new mehod and 
moddule; for example (A is the original package):

just write in X/ :
import A.B.C, B.C
A.B.C = B.C

and all "from A.B import C" following an import of X will return X.B.C. 

This is how we "monkeypatch" products in Zope.


Maric Michaud

Aristote -
3 place des tapis
69004 Lyon
Tel: +33 426 880 097

More information about the Python-list mailing list