import hook, overwrite import?

Torsten Mohr tmohr at
Wed Jan 26 00:44:51 EST 2005


is there some description available to overwrite the import
hook?  By googling i found out so far that i need to overwrite
__builtins__.__import__ with something else.

Can i also do this with a C function that is provided when
using an embedded python interpreter?  So my own C program
provides this and when linking with python.lib the function
is overwritten?

Or is there some extension hook?

Does this also handle "from module import *" not only the normal
"import module"?

Thanks for any hints,

More information about the Python-list mailing list