[Python-Dev] import problems (original) (raw)
Nick Coghlan ncoghlan at gmail.com
Sat Nov 29 03:56:00 CET 2008
- Previous message: [Python-Dev] __import__ problems
- Next message: [Python-Dev] __import__ problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Steven D'Aprano wrote:
Should this be reported as a documentation bug? Given the new import hooks, would it be fair to say that the main reason for import is to use it to import a module whose name is only known at runtime?
Only known at runtime, and for some reason you want an actual module object rather than just the module's global namespace (since you can use runpy.run_module() if you only need the latter).
At the very least, the import docs should probably be updated to point to run_module() as an alternative approach, so a doc issue is probably a good idea.
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 ]