classification
Title: Update Index for set, dict, and generator 'comprehensions'
Type: behavior Stage: needs patch
Components: Documentation Versions: Python 3.10, Python 3.9, Python 3.8, Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: DahlitzFlorian, docs@python, louielu, r.david.murray, terry.reedy
Priority: normal Keywords: easy

Created on 2017-04-04 18:01 by terry.reedy, last changed 2020-05-21 07:17 by DahlitzFlorian.

Pull Requests
URL Status Linked Edit
PR 995 closed louielu, 2017-04-05 05:08
PR 20272 open DahlitzFlorian, 2020-05-20 21:18
Messages (7)
msg291129 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-04-04 18:01
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'
msg291132 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-04-04 18:33
See #29983 for expanding the title of the 'atoms' section containing subsections on comprehensions.
msg296580 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-06-21 20:18
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.
msg369475 - (view) Author: Florian Dahlitz (DahlitzFlorian) * Date: 2020-05-20 20:13
I would like to work on this issue if it is still open.
msg369489 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-21 02:48
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).
msg369490 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-21 02:55
I wrote the above before your PR was listed here.  I will review it a piece at a time.
msg369501 - (view) Author: Florian Dahlitz (DahlitzFlorian) * Date: 2020-05-21 07:17
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!
History
Date User Action Args
2020-05-21 07:17:44DahlitzFloriansetmessages: + msg369501
2020-05-21 02:55:15terry.reedysetmessages: + msg369490
2020-05-21 02:48:26terry.reedysetkeywords: - patch

stage: patch review -> needs patch
messages: + msg369489
versions: + Python 3.8, Python 3.9, Python 3.10, - Python 3.6
2020-05-20 21:18:35DahlitzFloriansetkeywords: + patch
pull_requests: + pull_request19552
2020-05-20 20:13:34DahlitzFloriansetnosy: + DahlitzFlorian
messages: + msg369475
2017-06-21 20:18:14r.david.murraysetnosy: + r.david.murray
messages: + msg296580
2017-06-07 18:07:16Mariattasetstage: needs patch -> patch review
2017-04-05 05:08:07louielusetpull_requests: + pull_request1170
2017-04-05 04:35:34louielusetnosy: + louielu
2017-04-04 18:33:04terry.reedysetmessages: + msg291132
title: Update Index set, dict, and generator 'comprehensions' -> Update Index for set, dict, and generator 'comprehensions'
2017-04-04 18:01:11terry.reedycreate