Message76466
Attached is a naive proof-of-concept implementation (that breaks things,
i.e. the real implementation should strive for better
general compatibility), but works as expected:
>>> __import__('imprt.foo.foo', submodule=True)
<module 'imprt.foo.foo' from 'imprt/foo/foo.py'>
>>> __import__('imprt.foo.foo', submodule=False)
<module 'imprt' from 'imprt/__init__.py'>
>>> __import__('imprt.foo.foo')
<module 'imprt' from 'imprt/__init__.py'>
# Die on unexpected arguments like strings, lists etc to
# avoid confusion
>>> __import__('imprt.foo.foo', submodule='z')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: an integer is required |
|
Date |
User |
Action |
Args |
2008-11-26 14:23:59 | mrts | set | recipients:
+ mrts |
2008-11-26 14:23:59 | mrts | set | messageid: <1227709439.1.0.0951303831853.issue4438@psf.upfronthosting.co.za> |
2008-11-26 14:23:58 | mrts | link | issue4438 messages |
2008-11-26 14:23:57 | mrts | create | |
|