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/083769.html below:

[Python-Dev] __import__ problems

[Python-Dev] __import__ problems [Python-Dev] __import__ problemsNick Coghlan ncoghlan at gmail.com
Fri Nov 28 23:25:26 CET 2008
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.import_module().
> 
> 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
---------------------------------------------------------------
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