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>
diff --git a/Doc/reference/expressions.rst b/Doc/reference/expressions.rst
index b68c298..81dd6fc 100644
--- a/Doc/reference/expressions.rst
+++ b/Doc/reference/expressions.rst
@@ -162,6 +162,8 @@
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 @@
.. index::
pair: set; display
+ pair: set; comprehensions
object: set
single: {} (curly brackets); set expression
single: , (comma); expression list
@@ -287,6 +290,7 @@
.. index::
pair: dictionary; display
+ pair: dictionary; comprehensions
key, datum, key/datum pair
object: dictionary
single: {} (curly brackets); dictionary expression