@@ -223,27 +223,16 @@ A set display is denoted by curly braces and distinguishable from dictionary
223223displays by the lack of colons separating keys and values:
224224
225225.. productionlist ::
226- set_display: "{" [ `expression_list ` | `comprehension `] "}"
226+ set_display: "{" ( `expression_list ` | `comprehension `) "}"
227227
228228A set display yields a new mutable set object, the contents being specified by
229229either a sequence of expressions or a comprehension. When a comma-separated
230230list of expressions is supplied, its elements are evaluated from left to right
231231and added to the set object. When a comprehension is supplied, the set is
232232constructed from the elements resulting from the comprehension.
233233
234-
235- Variables used in the generator expression are evaluated lazily in a separate
236- scope when the :meth: `next ` method is called for the generator object (in the
237- same fashion as for normal generators). However, the :keyword: `in ` expression
238- of the leftmost :keyword: `for ` clause is immediately evaluated in the current
239- scope so that an error produced by it can be seen before any other possible
240- error in the code that handles the generator expression. Subsequent
241- :keyword: `for ` and :keyword: `if ` clauses cannot be evaluated immediately since
242- they may depend on the previous :keyword: `for ` loop. For example:
243- ``(x*y for x in range(10) for y in bar(x)) ``.
244-
245- The parentheses can be omitted on calls with only one argument. See section
246- :ref: `calls ` for the detail.
234+ An empty set cannot be constructed with ``{} ``; this literal constructs an empty
235+ dictionary.
247236
248237
249238.. _dict :
0 commit comments