{{ message }}
bpo-23677: Mention dict and set comprehension in stdtypes - #20027
Closed
furkanonder wants to merge 8 commits into
Closed
furkanonder wants to merge 8 commits into
furkanonder wants to merge 8 commits into
Conversation
rhettinger
requested changes
May 11, 2020
Contributor
Author
|
I have made the requested changes; please review again. |
|
Thanks for making the requested changes! @rhettinger: please review the changes made to this pull request. |
iritkatriel
reviewed
Oct 3, 2020
rhettinger
reviewed
Oct 18, 2021
iritkatriel
reviewed
Dec 13, 2021
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Comment on lines
+4109
to
+4112
| of elements within braces, for example: ``{'jack', 'sjoerd'}``. Sets can | ||
| be created by using a set comprehension, for example ``{2 * x for x in iterable}``. | ||
| Also, set comprehensions can make both empty and non-empty sets. In addition to | ||
| the :class:`set` constructor. |
Member
There was a problem hiding this comment.
Suggested change
| of elements within braces, for example: ``{'jack', 'sjoerd'}``. Sets can | |
| be created by using a set comprehension, for example ``{2 * x for x in iterable}``. | |
| Also, set comprehensions can make both empty and non-empty sets. In addition to | |
| the :class:`set` constructor. | |
| of elements within braces, for example ``{'jack', 'sjoerd'}``. Sets can | |
| be created by using a :term:`set comprehension`, for example ``{2 * x for x in iterable}``, | |
| or using the :class:`set` constructor. |
- Remove unnecessary sentence about creating empty sets using a setcomp.
- Fix incomplete sentence
- Link to the glossary
Comment on lines
+4308
to
+4310
| 'jack', 4127: 'sjoerd'}``, by a dict comprehension, for example: ``{x: x**2 for | ||
| x in iterable}``. Dictionaries can also be created by the :class:`dict` | ||
| constructor, for example: ``dict(jack=4098, sjoerd=4127)``. |
Member
There was a problem hiding this comment.
Suggested change
| 'jack', 4127: 'sjoerd'}``, by a dict comprehension, for example: ``{x: x**2 for | |
| x in iterable}``. Dictionaries can also be created by the :class:`dict` | |
| constructor, for example: ``dict(jack=4098, sjoerd=4127)``. | |
| 'jack', 4127: 'sjoerd'}``, or by a :term:`dictionary comprehension`, for example: ``{x: x**2 for | |
| x in iterable}``. Dictionaries can also be created by the :class:`dict` | |
| constructor, for example: ``dict(jack=4098, sjoerd=4127)``. |
Link the glossary term
Contributor
|
Thanks for the suggestion, but I'm going to decline. This section is about set objects and it doesn't make sense to be talking about dictionary comprehensions here. We cover mention set comprehensions right at the top of the object description ( https://docs.python.org/3/library/stdtypes.html#set ). This is consistent with how we document ways to create lists ( https://docs.python.org/3/library/stdtypes.html#list ). |
Member
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

https://bugs.python.org/issue23677