summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_itertools.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2009-02-19 02:15:14 (GMT)
committerRaymond Hettinger <python@rcn.com>2009-02-19 02:15:14 (GMT)
commit2e2909f58482f5c780c58549f04f7cf325b94e02 (patch)
tree4fe3fb9b2305efe850f5f54a2fe5b9858b9ea3e2 /Lib/test/test_itertools.py
parent08259e8f254a0595f8ed1be29b2d135f9b0d2d50 (diff)
downloadcpython-2e2909f58482f5c780c58549f04f7cf325b94e02.zip
cpython-2e2909f58482f5c780c58549f04f7cf325b94e02.tar.gz
cpython-2e2909f58482f5c780c58549f04f7cf325b94e02.tar.bz2
Add keyword arg support to itertools.compress().
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r--Lib/test/test_itertools.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py
index a33939e..2cdb1d7 100644
--- a/Lib/test/test_itertools.py
+++ b/Lib/test/test_itertools.py
@@ -306,6 +306,7 @@ class TestBasicOps(unittest.TestCase):
self.assertEqual(comb, sorted(set(cwr) & set(perm))) # comb: both a cwr and a perm
def test_compress(self):
+ self.assertEqual(list(compress(data='ABCDEF', selectors=[1,0,1,0,1,1])), list('ACEF'))
self.assertEqual(list(compress('ABCDEF', [1,0,1,0,1,1])), list('ACEF'))
self.assertEqual(list(compress('ABCDEF', [0,0,0,0,0,0])), list(''))
self.assertEqual(list(compress('ABCDEF', [1,1,1,1,1,1])), list('ABCDEF'))