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: Help on importlib.resources outputs the builtin open description
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: barry Nosy List: barry, brett.cannon, eric.snow, ncoghlan, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-05-16 12:29 by serhiy.storchaka, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6902 closed serhiy.storchaka, 2018-05-16 12:32
PR 6920 merged barry, 2018-05-16 20:23
PR 6941 merged miss-islington, 2018-05-17 15:43
Messages (4)
msg316802 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-16 12:29
help(importlib.resources) outputs many noise. In particular it contains the description of builtin open() which is longer than descriptions of all functions defined in importlib.resources. It also contains references to typing classes in the DATA section.

There are two ways of solving this problem. First way: make all imported names underscored (for example _open instead of builtin_open). Second way: add __all__.

Actually I don't understand why buildin_open is used instead of just open. And _zipimport_get_resource_reader looks unused.
msg316856 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2018-05-16 20:01
Thanks, I will add an __all__

_zipimport_get_resource_reader gets called from C and it's the way we trampoline from the inscrutable zipimport.c into something we can more reasonably implement the ResourceReader API.  There's a comment above _ZipImportResourceReader but do you think that's easy to miss or misunderstand?

The use of builtins_open is historical; the importlib.resources name used to be `open`.  I think we can get rid of this cruft, as it's just an implementation detail.

I'll work on a PR
msg316951 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2018-05-17 15:41
New changeset 0ed66df5242138fc599b4735749e55f953d9a1e4 by Barry Warsaw in branch 'master':
bpo-33537: Add an __all__ to importlib.resources (#6920)
https://github.com/python/cpython/commit/0ed66df5242138fc599b4735749e55f953d9a1e4
msg316960 - (view) Author: Barry A. Warsaw (barry) * (Python committer) Date: 2018-05-17 16:27
New changeset 6417d33633a3979d996015e52e4ff6c7a88e93e5 by Barry Warsaw (Miss Islington (bot)) in branch '3.7':
bpo-33537: Add an __all__ to importlib.resources (GH-6920) (#6941)
https://github.com/python/cpython/commit/6417d33633a3979d996015e52e4ff6c7a88e93e5
History
Date User Action Args
2022-04-11 14:59:00adminsetgithub: 77718
2018-05-23 05:19:03serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-05-17 16:27:51barrysetmessages: + msg316960
2018-05-17 15:43:03miss-islingtonsetpull_requests: + pull_request6610
2018-05-17 15:41:55barrysetmessages: + msg316951
2018-05-16 20:23:05barrysetpull_requests: + pull_request6589
2018-05-16 20:02:15barrysetassignee: barry
2018-05-16 20:01:49barrysetmessages: + msg316856
2018-05-16 13:35:17petr.viktorinsetnosy: + barry
2018-05-16 12:32:10serhiy.storchakasetkeywords: + patch
stage: patch review
pull_requests: + pull_request6572
2018-05-16 12:29:28serhiy.storchakacreate