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.

classification
Title: Doc fix in the Import section in language reference.
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, docs@python, eric.snow, jon.poler, python-dev
Priority: normal Keywords: patch

Created on 2014-08-21 14:55 by jon.poler, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
import_doc_fix.patch jon.poler, 2014-08-21 14:55 Minor change to import documentation in the language reference.
Messages (3)
msg225610 - (view) Author: Jon Poler (jon.poler) * Date: 2014-08-21 14:55
It looks like there might be a contradiction in the documentation of import in the language reference. In the loading subsection https://docs.python.org/dev/reference/import.html#loading, first bulleted list of the section, it specifies that if a loader fails, it must remove only the failing module from sys.modules, while other side-effect imports by loader will stay in sys.modules.

In the next subsection https://docs.python.org/dev/reference/import.html#loaders, second bulleted list (last bullet), the phrasing is confusing, and possibly contradictory. I believe that it meant to reiterate what was said above (see my previous paragraph).

Attached is a potential patch, but if anyone finds that I am interpreting this wrong, I'll make adjustments accordingly.
msg230815 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-11-07 16:29
New changeset f473063318c3 by Brett Cannon in branch 'default':
Issue #22242: Try to make some import-related loader details clearer.
https://hg.python.org/cpython/rev/f473063318c3
msg230816 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-11-07 16:31
So the second point isn't contradictory, just more thorough (and had a mad mix of singular/plural wording). Loaders could add more than one module if they chose to. The key point is that when a load fails, only the modules that failed and that the loader itself was directly involved with loading should be removed from sys.modules.

I tried to fix the plurality of the words in the second part to help clear things up.
History
Date User Action Args
2022-04-11 14:58:07adminsetgithub: 66438
2014-11-07 16:31:41brett.cannonsetstatus: open -> closed
resolution: fixed
messages: + msg230816

stage: patch review -> resolved
2014-11-07 16:29:46python-devsetnosy: + python-dev
messages: + msg230815
2014-10-28 13:39:45brett.cannonsetassignee: docs@python -> brett.cannon
2014-10-28 13:26:44ezio.melottisetnosy: + brett.cannon

stage: patch review
2014-08-21 21:18:37ned.deilysetnosy: + eric.snow
2014-08-21 14:55:27jon.polercreate