[Python-3000-checkins] r66522 - python/branches/py3k/Doc/reference/expressions.rst

georg.brandl python-3000-checkins at python.org
Sun Sep 21 09:09:52 CEST 2008


Author: georg.brandl
Date: Sun Sep 21 09:09:51 2008
New Revision: 66522

Log:
#3917: don't allow {} as a set display.


Modified:
   python/branches/py3k/Doc/reference/expressions.rst

Modified: python/branches/py3k/Doc/reference/expressions.rst
==============================================================================
--- python/branches/py3k/Doc/reference/expressions.rst	(original)
+++ python/branches/py3k/Doc/reference/expressions.rst	Sun Sep 21 09:09:51 2008
@@ -223,7 +223,7 @@
 displays by the lack of colons separating keys and values:
 
 .. productionlist::
-   set_display: "{" [`expression_list` | `comprehension`] "}"
+   set_display: "{" (`expression_list` | `comprehension`) "}"
 
 A set display yields a new mutable set object, the contents being specified by
 either a sequence of expressions or a comprehension.  When a comma-separated
@@ -231,19 +231,8 @@
 and added to the set object.  When a comprehension is supplied, the set is
 constructed from the elements resulting from the comprehension.
 
-
-Variables used in the generator expression are evaluated lazily in a separate
-scope when the :meth:`next` method is called for the generator object (in the
-same fashion as for normal generators).  However, the :keyword:`in` expression
-of the leftmost :keyword:`for` clause is immediately evaluated in the current
-scope so that an error produced by it can be seen before any other possible
-error in the code that handles the generator expression.  Subsequent
-:keyword:`for` and :keyword:`if` clauses cannot be evaluated immediately since
-they may depend on the previous :keyword:`for` loop.  For example:
-``(x*y for x in range(10) for y in bar(x))``.
-
-The parentheses can be omitted on calls with only one argument. See section
-:ref:`calls` for the detail.
+An empty set cannot be constructed with ``{}``; this literal constructs an empty
+dictionary.
 
 
 .. _dict:


More information about the Python-3000-checkins mailing list