Issue 33537: Help on importlib.resources outputs the builtin open description
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) * ![]() |
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) * ![]() |
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) * ![]() |
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) * ![]() |
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:00 | admin | set | github: 77718 |
| 2018-05-23 05:19:03 | serhiy.storchaka | set | status: open -> closed resolution: fixed stage: patch review -> resolved |
| 2018-05-17 16:27:51 | barry | set | messages: + msg316960 |
| 2018-05-17 15:43:03 | miss-islington | set | pull_requests: + pull_request6610 |
| 2018-05-17 15:41:55 | barry | set | messages: + msg316951 |
| 2018-05-16 20:23:05 | barry | set | pull_requests: + pull_request6589 |
| 2018-05-16 20:02:15 | barry | set | assignee: barry |
| 2018-05-16 20:01:49 | barry | set | messages: + msg316856 |
| 2018-05-16 13:35:17 | petr.viktorin | set | nosy:
+ barry |
| 2018-05-16 12:32:10 | serhiy.storchaka | set | keywords:
+ patch stage: patch review pull_requests: + pull_request6572 |
| 2018-05-16 12:29:28 | serhiy.storchaka | create | |
