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 ---------------------------------------------------------------
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