mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
bpo-29981: Add examples and update index for set, dict, and generator comprehensions'(GH-20272)
Co-authored-by: Rémi Lapeyre <remi.lapeyre@henki.fr>
This commit is contained in:
parent
5ab27cc518
commit
2d55aa9e37
4 changed files with 31 additions and 0 deletions
|
|
@ -162,6 +162,8 @@ ambiguities and allow common typos to pass uncaught.
|
|||
Displays for lists, sets and dictionaries
|
||||
-----------------------------------------
|
||||
|
||||
.. index:: single: comprehensions
|
||||
|
||||
For constructing a list, a set or a dictionary Python provides special syntax
|
||||
called "displays", each of them in two flavors:
|
||||
|
||||
|
|
@ -260,6 +262,7 @@ Set displays
|
|||
|
||||
.. index::
|
||||
pair: set; display
|
||||
pair: set; comprehensions
|
||||
object: set
|
||||
single: {} (curly brackets); set expression
|
||||
single: , (comma); expression list
|
||||
|
|
@ -287,6 +290,7 @@ Dictionary displays
|
|||
|
||||
.. index::
|
||||
pair: dictionary; display
|
||||
pair: dictionary; comprehensions
|
||||
key, datum, key/datum pair
|
||||
object: dictionary
|
||||
single: {} (curly brackets); dictionary expression
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue