[Python-checkins] cpython (3.2): Rephrase a sentence in the set and dict comprehensions tutorial page.
ezio.melotti
python-checkins at python.org
Sat Nov 17 11:06:59 CET 2012
http://hg.python.org/cpython/rev/49cf38158c8b
changeset: 80460:49cf38158c8b
branch: 3.2
parent: 80456:542bf1c1f2e3
user: Ezio Melotti <ezio.melotti at gmail.com>
date: Sat Nov 17 12:06:01 2012 +0200
summary:
Rephrase a sentence in the set and dict comprehensions tutorial page.
files:
Doc/tutorial/datastructures.rst | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -413,7 +413,7 @@
eliminating duplicate entries. Set objects also support mathematical operations
like union, intersection, difference, and symmetric difference.
-Curly braces or the :func:`set` function can be used to create sets. Note: To
+Curly braces or the :func:`set` function can be used to create sets. Note: to
create an empty set you have to use ``set()``, not ``{}``; the latter creates an
empty dictionary, a data structure that we discuss in the next section.
@@ -442,14 +442,14 @@
>>> a ^ b # letters in a or b but not both
{'r', 'd', 'b', 'm', 'z', 'l'}
-Like :ref:`for lists <tut-listcomps>`, there is a set comprehension syntax::
+Similarly to :ref:`list comprehensions <tut-listcomps>`, set comprehensions
+are also supported::
>>> a = {x for x in 'abracadabra' if x not in 'abc'}
>>> a
{'r', 'd'}
-
.. _tut-dictionaries:
Dictionaries
--
Repository URL: http://hg.python.org/cpython
More information about the Python-checkins
mailing list