You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update Index for set, dict, and generator 'comprehensions' #74167
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=<Date2020-10-25.02:57:18.912>created_at=<Date2017-04-04.18:01:11.476>labels= ['easy', 'type-bug', '3.8', '3.9', '3.10', 'docs']
title="Update Index for set, dict, and generator 'comprehensions'"updated_at=<Date2020-10-25.02:57:18.912>user='https://github.com/terryjreedy'
Link *comprehensions* to 6.2.4. Displays for lists, sets and dictionaries
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.
changed the title [-]Update Index set, dict, and generator 'comprehensions'[/-][+]Update Index for set, dict, and generator 'comprehensions'[/+]on Apr 4, 2017
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).
I wrote the above before your PR was listed here. I will review it a piece at a time.
DahlitzFlorian commented on May 21, 2020
DahlitzFlorianmannequin
Mannequin
More actions
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!
New changeset 2d55aa9 by Florian Dahlitz in branch 'master': bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272) 2d55aa9
New changeset 60bef61 by Miss Skeleton (bot) in branch '3.8': bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272) 60bef61
New changeset 2cccc29 by Miss Skeleton (bot) in branch '3.9': bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272) 2cccc29
Activity
terryjreedy commentedon Apr 4, 2017
The index currently has
comprehensions
*list*
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'.
terryjreedy commentedon Apr 4, 2017
See bpo-29983 for expanding the title of the 'atoms' section containing subsections on comprehensions.
[-]Update Index set, dict, and generator 'comprehensions'[/-][+]Update Index for set, dict, and generator 'comprehensions'[/+]bitdancer commentedon Jun 21, 2017
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.
DahlitzFlorian commentedon May 20, 2020
I would like to work on this issue if it is still open.
terryjreedy commentedon May 21, 2020
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.
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.
terryjreedy commentedon May 21, 2020
I wrote the above before your PR was listed here. I will review it a piece at a time.
DahlitzFlorian commentedon May 21, 2020
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!
akuchling commentedon Oct 20, 2020
New changeset 2d55aa9 by Florian Dahlitz in branch 'master':
bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272)
2d55aa9
miss-islington commentedon Oct 25, 2020
New changeset 60bef61 by Miss Skeleton (bot) in branch '3.8':
bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272)
60bef61
miss-islington commentedon Oct 25, 2020
New changeset 2cccc29 by Miss Skeleton (bot) in branch '3.9':
bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272)
2cccc29