A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2008-November/083774.html below:

[Python-Dev] __import__ problems

[Python-Dev] __import__ problems [Python-Dev] __import__ problemsSteven D'Aprano steve at pearwood.info
Sat Nov 29 05:49:40 CET 2008
On Sat, 29 Nov 2008 01:56:00 pm Nick Coghlan wrote:
> 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.

Bug report is here:
http://bugs.python.org/issue4457

Based on Guido's comments, I haven't mentioned run_module().


-- 
Steven
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4