[Python-Dev] import problems (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Fri Nov 28 23:25:26 CET 2008
- Previous message: [Python-Dev] __import__ problems
- Next message: [Python-Dev] __import__ problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Mart Somermaa wrote:
But I'm still +1 for adding 'tail'/'submodule'/'tailmodule' argument to import instead of providing an almost identical copy in imp.importmodule().
Let me know which of the approaches is desired (if any) and I'll add tests and update docs.
Have you considered using runpy.run_module() instead? i.e. do you actually need the resulting module object, or just the global namespace produced by running its code?
If the latter, then run_module() is a much better way of going about it as it has (slightly) fewer side effects on the import system's internals.
Cheers, Nick.
-- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
- Previous message: [Python-Dev] __import__ problems
- Next message: [Python-Dev] __import__ problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]