[Python-Dev] import problems (original) (raw)
Christian Heimes lists at cheimes.de
Fri Nov 28 21:45:41 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 it is not. The proposed import(name, submodule=True) has a compatible interface. All tests pass with http://bugs.python.org/file12136/issue4438.diff .
Your approach complicates the interface. Every implementation of Python and every replacement import would have to implement the additional argument, too. There is simply no need to make the interface more complex when an additional, trivial function does the same job.
As for the imp approach, I've alternatively implemented imp.importmodule() that imports tail modules in http://bugs.python.org/file12147/impimportmodule.diff (colour diff in http://dpaste.com/hold/94431/). IMHO the functionality duplication with import is ugly, but if it is desired that import does not change (even in backwards-compatible way), so be it.
It's not a duplication of functionality. import() implements exactly the functionality that is required by Python's import system. Anything else can be implemented on top of it. We simply prefer divide 'n conquer over mingle 'n mix. :)
Christian
- Previous message: [Python-Dev] __import__ problems
- Next message: [Python-Dev] __import__ problems
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]