[issue22242] Doc fix in the Import section in language reference.
New submission from Jon Poler: 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. ---------- assignee: docs@python components: Documentation files: import_doc_fix.patch keywords: patch messages: 225610 nosy: docs@python, jon.poler priority: normal severity: normal status: open title: Doc fix in the Import section in language reference. type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file36427/import_doc_fix.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22242> _______________________________________
Changes by Ned Deily <nad@acm.org>: ---------- nosy: +eric.snow _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22242> _______________________________________
Changes by Ezio Melotti <ezio.melotti@gmail.com>: ---------- nosy: +brett.cannon stage: -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22242> _______________________________________
Changes by Brett Cannon <brett@python.org>: ---------- assignee: docs@python -> brett.cannon _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22242> _______________________________________
Roundup Robot added the comment: 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 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22242> _______________________________________
Brett Cannon added the comment: 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. ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue22242> _______________________________________
participants (5)
-
Brett Cannon -
Ezio Melotti -
Jon Poler -
Ned Deily -
Roundup Robot