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.
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:07 | admin | set | github: 66438 |
| 2014年11月07日 16:31:41 | brett.cannon | set | status: open -> closed resolution: fixed messages: + msg230816 stage: patch review -> resolved |
| 2014年11月07日 16:29:46 | python-dev | set | nosy:
+ python-dev messages: + msg230815 |
| 2014年10月28日 13:39:45 | brett.cannon | set | assignee: docs@python -> brett.cannon |
| 2014年10月28日 13:26:44 | ezio.melotti | set | nosy:
+ brett.cannon stage: patch review |
| 2014年08月21日 21:18:37 | ned.deily | set | nosy:
+ eric.snow |
| 2014年08月21日 14:55:27 | jon.poler | create | |