This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mrts
Recipients mrts
Date 2008-11-26.14:23:53
SpamBayes Score 4.5743798e-10
Marked as misclassified No
Message-id <1227709439.1.0.0951303831853.issue4438@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2008-11-26 14:23:59mrtssetrecipients: + mrts
2008-11-26 14:23:59mrtssetmessageid: <1227709439.1.0.0951303831853.issue4438@psf.upfronthosting.co.za>
2008-11-26 14:23:58mrtslinkissue4438 messages
2008-11-26 14:23:57mrtscreate