summaryrefslogtreecommitdiffstats
path: root/Doc/lib/libsets.tex
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2005-04-10 17:32:35 (GMT)
committerRaymond Hettinger <python@rcn.com>2005-04-10 17:32:35 (GMT)
commite490502e04f3c3847bd58183f4b6f284880c8709 (patch)
tree7ae98dcefff005c126c03c886f83e2f3282d67ee /Doc/lib/libsets.tex
parent95ed80b0e06e9e5722c68e3054dad9177e20d449 (diff)
downloadcpython-e490502e04f3c3847bd58183f4b6f284880c8709.zip
cpython-e490502e04f3c3847bd58183f4b6f284880c8709.tar.gz
cpython-e490502e04f3c3847bd58183f4b6f284880c8709.tar.bz2
SF bug #1179957: Missing def'n of equality for set elements
Diffstat (limited to 'Doc/lib/libsets.tex')
-rw-r--r--Doc/lib/libsets.tex5
1 files changed, 4 insertions, 1 deletions
diff --git a/Doc/lib/libsets.tex b/Doc/lib/libsets.tex
index 8085ab1..0cd5e2e 100644
--- a/Doc/lib/libsets.tex
+++ b/Doc/lib/libsets.tex
@@ -30,7 +30,10 @@ method but omits methods which alter the contents of the set. Both
abstract class useful for determining whether something is a set:
\code{isinstance(\var{obj}, BaseSet)}.
-The set classes are implemented using dictionaries. As a result, sets
+The set classes are implemented using dictionaries. Accordingly, the
+requirements for set elements are the same as those for dictionary keys;
+namely, that the element defines both \method{__eq__} and \method{__hash__}.
+As a result, sets
cannot contain mutable elements such as lists or dictionaries.
However, they can contain immutable collections such as tuples or
instances of \class{ImmutableSet}. For convenience in implementing