bpo-23677: Mention dict and set comprehension in stdtypes - #20027
bpo-23677: Mention dict and set comprehension in stdtypes#20027furkanonder wants to merge 8 commits into
Conversation
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
|
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. |
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
| 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. |
There was a problem hiding this comment.
| 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
| '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)``. |
There was a problem hiding this comment.
| '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
|
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 ). |
|
@rhettinger the changes in this PR that talk about sets are in a section about sets. |
https://bugs.python.org/issue23677