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.

Title: Update docs for importlib.import_module()
Type: Stage: needs patch
Components: Documentation Versions: Python 3.3, Python 3.4
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 2022-04-11 14:57 by admin. 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
>>> 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/'>

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) (Python triager) 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

New changeset 33938321d46f by Brett Cannon in branch 'default':
merge for issue #19963
Date User Action Args
2022-04-11 14:57:55adminsetgithub: 64162
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