summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-06-09 08:33:37 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-06-09 08:33:37 (GMT)
commitee4bcad68ec383c0140d0a21f4ac296073c0f938 (patch)
tree788d1a8051f676ade6b8213314c6aec6f1b893b7 /Lib
parentecbdd2e9b0a5af20a2b8784ac91338739b99ce3d (diff)
downloadcpython-ee4bcad68ec383c0140d0a21f4ac296073c0f938.zip
cpython-ee4bcad68ec383c0140d0a21f4ac296073c0f938.tar.gz
cpython-ee4bcad68ec383c0140d0a21f4ac296073c0f938.tar.bz2
Let set.union() and set.update() accept multiple inputs.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_set.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 6b3df3d..37a085c 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -78,6 +78,7 @@ class TestJointOps(unittest.TestCase):
self.assertEqual(self.thetype('abcba').union(C('efgfe')), set('abcefg'))
self.assertEqual(self.thetype('abcba').union(C('ccb')), set('abc'))
self.assertEqual(self.thetype('abcba').union(C('ef')), set('abcef'))
+ self.assertEqual(self.thetype('abcba').union(C('ef'), C('fg')), set('abcefg'))
def test_or(self):
i = self.s.union(self.otherword)
@@ -401,6 +402,12 @@ class TestSet(TestJointOps):
s = self.thetype('abcba')
self.assertEqual(s.update(C(p)), None)
self.assertEqual(s, set(q))
+ for p in ('cdc', 'efgfe', 'ccb', 'ef', 'abcda'):
+ q = 'ahi'
+ for C in set, frozenset, dict.fromkeys, str, unicode, list, tuple:
+ s = self.thetype('abcba')
+ self.assertEqual(s.update(C(p), C(q)), None)
+ self.assertEqual(s, set(s) | set(p) | set(q))
def test_ior(self):
self.s |= set(self.otherword)