summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_set.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2008-06-09 13:07:27 (GMT)
committerRaymond Hettinger <python@rcn.com>2008-06-09 13:07:27 (GMT)
commit5c4d3d0e4c6b533dbfbab36ad8034010fe90cf69 (patch)
tree941131a004cf5bac5197ad5fdd0b11b91aaae50c /Lib/test/test_set.py
parentd62341414109ff16d6477e370e380c6dec9db9d6 (diff)
downloadcpython-5c4d3d0e4c6b533dbfbab36ad8034010fe90cf69.zip
cpython-5c4d3d0e4c6b533dbfbab36ad8034010fe90cf69.tar.gz
cpython-5c4d3d0e4c6b533dbfbab36ad8034010fe90cf69.tar.bz2
Let set.intersection() and set.intersection_update() take multiple input arguments.
Diffstat (limited to 'Lib/test/test_set.py')
-rw-r--r--Lib/test/test_set.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py
index 37a085c..729cc3b 100644
--- a/Lib/test/test_set.py
+++ b/Lib/test/test_set.py
@@ -103,6 +103,7 @@ class TestJointOps(unittest.TestCase):
self.assertEqual(self.thetype('abcba').intersection(C('efgfe')), set(''))
self.assertEqual(self.thetype('abcba').intersection(C('ccb')), set('bc'))
self.assertEqual(self.thetype('abcba').intersection(C('ef')), set(''))
+ self.assertEqual(self.thetype('abcba').intersection(C('cbcf'), C('bag')), set('b'))
def test_isdisjoint(self):
def f(s1, s2):
@@ -429,6 +430,11 @@ class TestSet(TestJointOps):
s = self.thetype('abcba')
self.assertEqual(s.intersection_update(C(p)), None)
self.assertEqual(s, set(q))
+ ss = 'abcba'
+ s = self.thetype(ss)
+ t = 'cbc'
+ self.assertEqual(s.intersection_update(C(p), C(t)), None)
+ self.assertEqual(s, set('abcba')&set(p)&set(t))
def test_iand(self):
self.s &= set(self.otherword)