Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-23677: Mention dict and set comprehension in stdtypes #20027

Closed
wants to merge 8 commits into from

Conversation

furkanonder
Copy link
Sponsor Contributor

@furkanonder furkanonder commented May 10, 2020

Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
@bedevere-bot
Copy link

bedevere-bot commented May 11, 2020

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@furkanonder furkanonder requested a review from rhettinger May 12, 2020
@furkanonder
Copy link
Sponsor Contributor Author

furkanonder commented Jun 1, 2020

I have made the requested changes; please review again.

@bedevere-bot
Copy link

bedevere-bot commented Jun 1, 2020

Thanks for making the requested changes!

@rhettinger: please review the changes made to this pull request.

Doc/library/stdtypes.rst Show resolved Hide resolved
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
@furkanonder furkanonder requested a review from rhettinger Dec 13, 2021
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
Doc/library/stdtypes.rst Outdated Show resolved Hide resolved
rhettinger and others added 2 commits Jan 2, 2022
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.
Copy link
Member

@JelleZijlstra JelleZijlstra Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

'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)``.
Copy link
Member

@JelleZijlstra JelleZijlstra Apr 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@rhettinger
Copy link
Contributor

rhettinger commented Apr 18, 2022

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 rhettinger closed this Apr 18, 2022
@JelleZijlstra
Copy link
Member

JelleZijlstra commented Apr 18, 2022

@rhettinger the changes in this PR that talk about sets are in a section about sets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants