From 89b03b0ec6ade7bce04aa3bdd9f43dc47781de4a Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sat, 17 Nov 2012 12:06:01 +0200 Subject: Rephrase a sentence in the set and dict comprehensions tutorial page. --- Doc/tutorial/datastructures.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index e008dd8..0ee4dca 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -413,7 +413,7 @@ with no duplicate elements. Basic uses include membership testing and 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 @@ Here is a brief demonstration:: >>> a ^ b # letters in a or b but not both {'r', 'd', 'b', 'm', 'z', 'l'} -Like :ref:`for lists `, there is a set comprehension syntax:: +Similarly to :ref:`list comprehensions `, set comprehensions +are also supported:: >>> a = {x for x in 'abracadabra' if x not in 'abc'} >>> a {'r', 'd'} - .. _tut-dictionaries: Dictionaries -- cgit v0.12