classification
Title: Update docs for importlib.import_module()
Type: Stage: needs patch
Components: Documentation Versions: Python 3.4, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, python-dev
Priority: normal Keywords:

Created on 2013-12-12 15:51 by brett.cannon, last changed 2013-12-13 18:59 by brett.cannon. This issue is now closed.

Messages (2)
msg205958 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2013-12-12 15:51
The docs for importlib.import_module() say that you need to import parent packages first, but this is actually no longer the case (thankfully):

Python 3.4.0b1 (default:a3bdbe220f8a, Dec 10 2013, 11:07:04) 
[GCC 4.6.3] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> 'test' in sys.modules
False
>>> import importlib
>>> importlib.import_module('test.test_importlib.source')
<module 'test.test_importlib.source' from '/usr/local/google/home/bcannon/Repos/cpython/default/Lib/test/test_importlib/source/__init__.py'>


Also need to check if this is false in Python 3.3 (or wherever the change occurred) to update the docs there and to add a versionchanged flag.
msg206136 - (view) Author: Roundup Robot (python-dev) Date: 2013-12-13 18:58
New changeset a44be62026fc by Brett Cannon in branch '3.3':
Issue #19963: Document that importlib.import_module() will import
http://hg.python.org/cpython/rev/a44be62026fc

New changeset 33938321d46f by Brett Cannon in branch 'default':
merge for issue #19963
http://hg.python.org/cpython/rev/33938321d46f
History
Date User Action Args
2013-12-13 18:59:16brett.cannonsetstatus: open -> closed
resolution: fixed
2013-12-13 18:58:56python-devsetnosy: + python-dev
messages: + msg206136
2013-12-12 15:51:28brett.cannoncreate