[issue29981] Update Index set, dict, and generator 'comprehensions'

New submission from Terry J. Reedy: The index currently has comprehensions *list* with *list* linked to 6.2.5 List displays. I suggest: 1. Link *comprehensions* to 6.2.4. Displays for lists, sets and dictionaries 2. Add subentries *set*, *dict*, and *generator* linked to 2a. 6.2.6. Set displays 2b. 6.2.7. Dictionary displays 2c. 6.2.8. Generator expressions We don't *call* generator expressions 'generator comprehensions', but that is what they are syntactically and one looking for 'comprehensions' should be able to find them there. There is already *list* ... *comprehensions* ... *list comprehensions* with 'list' and 'list comprehensions' linked to glossary entries, while 'list, comprehensions' links to the same section as 'comprehensions, list'. 3. Add 'set/dictionary, comprehensions' sub-entries linked like 'list, com 4. Add Glossary entries and links like 'list comprehensions' ---------- assignee: docs@python components: Documentation keywords: easy messages: 291129 nosy: docs@python, terry.reedy priority: normal severity: normal stage: needs patch status: open title: Update Index set, dict, and generator 'comprehensions' type: behavior versions: Python 3.6, Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29981> _______________________________________

Terry J. Reedy added the comment: See #29983 for expanding the title of the 'atoms' section containing subsections on comprehensions. ---------- title: Update Index set, dict, and generator 'comprehensions' -> Update Index for set, dict, and generator 'comprehensions' _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29981> _______________________________________

Changes by Louie Lu <me@louie.lu>: ---------- nosy: +louielu _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29981> _______________________________________

Changes by Louie Lu <me@louie.lu>: ---------- pull_requests: +1170 _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29981> _______________________________________

Changes by Mariatta Wijaya <mariatta.wijaya@gmail.com>: ---------- stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29981> _______________________________________

R. David Murray added the comment: On the PR Berker wrote: I'm wondering if we should still advertise the use of set([...]). We replaced all instances of it with set literals in the stdlib. set([...]) is part of the language, and the python documentation is also a specification of the language, so I think the reference *must* stay. ---------- nosy: +r.david.murray _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue29981> _______________________________________

Florian Dahlitz <f2dahlitz@freenet.de> added the comment: I would like to work on this issue if it is still open. ---------- nosy: +DahlitzFlorian _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Change by Florian Dahlitz <f2dahlitz@freenet.de>: ---------- keywords: +patch pull_requests: +19552 pull_request: https://github.com/python/cpython/pull/20272 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Terry J. Reedy <tjreedy@udel.edu> added the comment: The issue is still open. The basic idea is to treat list, set, and dict in parallel fashions in the docs, mostly copying what is done with lists for the other two. In my original post, the title and items 1 to 3 are about index entries in Reference chapter 6, Expressions (reference/expressions.rst). I tacked on item 4 about adding entries to the Glossary (glossary.rst). These could easily be and for easier review should be separate PRs. The original PR, opened relatively soon after githup went public, was reviewed by 5 different committers, which is an unusually large number. It included both indexing and glossary changes, and added changes to the Library chapter on built-in types (stdtypes.rst). The last was the most controversial and definitely needed to be a followup PR. In June 2017, after much discussion and revision, Louie Lu switched his github account from 'louisom' to 'louielu' and ceased working on this. Some later, louisom/cpython was deleted and the PR closed for inactivity.
We don't *call* generator expressions 'generator comprehensions',
A subsequent pydev discussion approved of 'generator comprehension' and I believe some doc changes followed*. So I expect that the previous PR is somewhat obsolete. Pick either indexing Expressions or new Glossary entries and see what change you think is still needed and consider any discussion of that change on PR 995. Note: I am not sure that I reviewed (and approved) the index part of the patch, as I likely focused on other parts. You can propose (and justify) changes here before making a PR. * Any changes may or may not have been backported to 3.7, so it may or may not be possible to easily backport any new changes (with the robot). ---------- keywords: -patch stage: patch review -> needs patch versions: +Python 3.10, Python 3.8, Python 3.9 -Python 3.6 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Terry J. Reedy <tjreedy@udel.edu> added the comment: I wrote the above before your PR was listed here. I will review it a piece at a time. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Florian Dahlitz <f2dahlitz@freenet.de> added the comment: I guess it would have been good if I waited submitting a PR until you replied to my message. This way, I would have known that two separate PRs would be better suited here - sorry for that. Nevertheless, I read the discussions here and in PR #995 and I'm pretty sure that the proposed changes do fit into the documentation (pretty similar to those from PR #995). I'm eager to hear your or other people's feedback - thanks! ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

A.M. Kuchling <amk@amk.ca> added the comment: New changeset 2d55aa9e37c9c84f4f6a8135d0326da0bcd8f38b by Florian Dahlitz in branch 'master': bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272) https://github.com/python/cpython/commit/2d55aa9e37c9c84f4f6a8135d0326da0bcd... ---------- nosy: +akuchling _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- keywords: +patch nosy: +miss-islington nosy_count: 6.0 -> 7.0 pull_requests: +21790 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/22836 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +21791 pull_request: https://github.com/python/cpython/pull/22837 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 60bef61f717dde915058b03159b2c2e97d765858 by Miss Skeleton (bot) in branch '3.8': bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272) https://github.com/python/cpython/commit/60bef61f717dde915058b03159b2c2e97d7... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 2cccc29eaf20694006c03af0f4740abdf8ae5579 by Miss Skeleton (bot) in branch '3.9': bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272) https://github.com/python/cpython/commit/2cccc29eaf20694006c03af0f4740abdf8a... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________

Change by Inada Naoki <songofacandy@gmail.com>: ---------- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue29981> _______________________________________
participants (8)
-
A.M. Kuchling
-
Florian Dahlitz
-
Inada Naoki
-
Louie Lu
-
Mariatta Wijaya
-
miss-islington
-
R. David Murray
-
Terry J. Reedy