[issue20842] pkgutil docs should reference glossary terms not PEP 302
New submission from Nick Coghlan: The pkgutil docs still point at PEP 302 when mentioning loaders, importers, etc. They should reference the glossary terms (:term:`loader`, etc) instead. ---------- assignee: docs@python components: Documentation messages: 212630 nosy: docs@python, ncoghlan priority: normal severity: normal stage: needs patch status: open title: pkgutil docs should reference glossary terms not PEP 302 type: enhancement versions: Python 3.4, Python 3.5 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Changes by Éric Araujo <merwok@netwok.org>: ---------- nosy: +eric.araujo _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Kushal Das added the comment: Will submit a patch for this. ---------- nosy: +kushaldas _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Changes by Berker Peksag <berker.peksag@gmail.com>: ---------- keywords: +easy versions: +Python 3.6 -Python 3.4 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Jaysinh shukla added the comment: Submitting the patch for this issue. I observed the last message of respected Kushal but because the message was posted too earlier decided to submit patch. Thanks! ---------- keywords: +patch nosy: +jaysinh.shukla Added file: http://bugs.python.org/file43521/issue20842_v1.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Martin Panter added the comment: See also Issue 26896. Apparently some of the terms you are linking are used wrongly. ---------- nosy: +martin.panter _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Jaysinh shukla added the comment: Dear Martin, I observed your comment. I can see, issue mentioned by you http://bugs.python.org/issue26896 contains patch of clarifying the reference of Importer, Finder. The issue-26896 is still under review phase. It will be good step to update doc in this issue according to http://bugs.python.org/file42666/issue.diff patch? Thanks! ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Martin Panter added the comment: I’m not sure what the best solution is. I am just pointing out the problem. It seems an “importer” as mentioned in PEP 302 is more general than the current glossary definition. E.g. ImpImporter() returns an object that has a find_module() method (which partially makes it both a “meta path finder” and a “path entry finder”), but it has no load_module() method. So it fails the “importer” definition according to the current glossary. ---------- stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Oren Milman added the comment: Note that http://bugs.python.org/issue26896 is now closed (the patches proposed in it (with some minor changes) were committed). ---------- nosy: +Oren Milman _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Jaysinh shukla added the comment: Adding updated patch after merging Issue 26896. Requesting to review. Thanks! ---------- Added file: http://bugs.python.org/file43721/issue20842_v2.diff _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Martin Panter added the comment: I still think the links are too dense. Three links to the same term in two short paragraphs is too much. Do you think it would be okay to just link the first occurrence for pkgutil.ImpImporter? Also, there is still a problem at least the definition of “finder” used by the ImpImporter documentation. In PEP 302, “a finder object has a single method: finder.find_module(fullname, path=None)”. This seems to be a pretty good description of the ImpImporter API. However, by dropping the reference to PEP 302, and linking to the glossary definition, we are suggesting that ImpImporter implements importlib.abc.MetaPathFinder and/or importlib.abc.PathEntryFinder. Both these APIs require some sort of find_spec() method, which is not provided by ImpImporter. As I see it, either Python’s “finder” glossary entry should be adjusted to accommodate PEP 302, or we should retain the PEP 302 reference and not point at the wrong definition of “finder”. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Oren Milman added the comment: ImpImporter was first added in changeset 37808 (https://hg.python.org/cpython/rev/ccc0b5412799) and updated a day later in changeset 37821 (https://hg.python.org/cpython/rev/3135648026c4). Both of these commits were introduced to support PEP 302. Since then, ImpImporter remained quite the same, and was never changed to suit later relevant PEPs (e.g. PEP 420 and PEP 451). Thus, IMHO, we should go with your second option, Martin, and retain the PEP 302 reference in ImpImporter documentation. With regard to the accuracy of Python's 'finder' glossary entry, it was updated recently, in changeset 99434 (https://hg.python.org/cpython/rev/88cee7d16ccb), to suit PEP 302, PEP 420 and PEP 451, so ISTM there is no need to adjust it. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Senthil Kumaran added the comment: I agree with the comment made by Oren. Not all instances of finder should be referenced as generic finder. Some classes and functions are are still PEP 302 specific finder. In the commit, 3987667bf98f Nick Coghlan modified the following functions to to use importlib module, thus serving the PEP 302 bind. So these can refer to glossary entry for finder. The documentation has been updated with version changed information. * get_importer (by the underlying change of using only sys.path_importer_cache and removing the use of ImpImporter) * iter_importers (by using importlib.import_module) The glossary entry for both finder and loader has been updated to include both PEP 302 finder, and with PEP 420 and PEP 451. With these changes already in place, I updated the patch to reflect the current state. I am proceed with the commit as this is a non-controversial change. If there are comments, please share and I will address them. ---------- nosy: +orsenthil Added file: http://bugs.python.org/file44381/issue20842-v3.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Senthil Kumaran added the comment: For 3.5 version of patch, we have bring in some additional changes from issue26896 which properly clarified finder from importer. These changes are not required in the default branch. ---------- _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Senthil Kumaran added the comment: This is 3.3 version of patch attached. ---------- Added file: http://bugs.python.org/file44383/issue20842-3.3-v5.patch _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Senthil Kumaran added the comment: Change committed. - 3.5 * 103098:ecbad01262c8 - default * 103099:ee58ece83391 ---------- resolution: -> fixed stage: patch review -> commit review status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
Roundup Robot added the comment: New changeset a4360b1b45a8 by Senthil Kumaran in branch 'default': issue20842 - null merge with 3.5 https://hg.python.org/cpython/rev/a4360b1b45a8 ---------- nosy: +python-dev _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue20842> _______________________________________
participants (9)
-
Berker Peksag
-
Jaysinh shukla
-
Kushal Das
-
Martin Panter
-
Nick Coghlan
-
Oren Milman
-
Roundup Robot
-
Senthil Kumaran
-
Éric Araujo