Merge rephrasing with 3.2.

This commit is contained in:
Ezio Melotti 2012-11-17 12:06:26 +02:00
commit 0bbfae3be4
1 changed files with 3 additions and 3 deletions

View File

@ -418,7 +418,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.
@ -447,14 +447,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 <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