[Python-Dev] import problems (original) (raw)

Hrvoje Niksic hrvoje.niksic at avl.com
Thu Nov 27 17:14:57 CET 2008


Mart Somermaa wrote:

There at least two workarounds: * the getattr approach documented in [3]

I can't comment on the rest, but the getattr seems overly complicated. If you need just the module, what's wrong with:

import(modname) modobj = sys.modules[modname]



More information about the Python-Dev mailing list