diff options
author | Raymond Hettinger <python@rcn.com> | 2008-01-17 03:02:14 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2008-01-17 03:02:14 +0000 |
commit | 473170908e11e347aca4adf23738a82162b981e3 (patch) | |
tree | 2fa25a5ccd4abfc71e6a0f5193838a726ce4c68a /Lib/test/test_itertools.py | |
parent | 3ad2acc8575e1977cece844b17c572550503a615 (diff) | |
download | cpython-git-473170908e11e347aca4adf23738a82162b981e3.tar.gz |
Make starmap() match its pure python definition and accept any itertable input (not just tuples).
Diffstat (limited to 'Lib/test/test_itertools.py')
-rw-r--r-- | Lib/test/test_itertools.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index 1a3064c305..9d1922823d 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -292,7 +292,8 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(take(3, starmap(operator.pow, izip(count(), count(1)))), [0**1, 1**2, 2**3]) self.assertEqual(list(starmap(operator.pow, [])), []) - self.assertRaises(TypeError, list, starmap(operator.pow, [[4,5]])) + self.assertEqual(list(starmap(operator.pow, [iter([4,5])])), [4**5]) + self.assertRaises(TypeError, list, starmap(operator.pow, [None])) self.assertRaises(TypeError, starmap) self.assertRaises(TypeError, starmap, operator.pow, [(4,5)], 'extra') self.assertRaises(TypeError, starmap(10, [(4,5)]).next) |