diff options
author | Raymond Hettinger <python@rcn.com> | 2003-05-02 19:44:20 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-05-02 19:44:20 (GMT) |
commit | 341deb74e7ec78eaf99838669ce04871e9f15783 (patch) | |
tree | c3c8257703ef5e718c8f850945dc2e7070f25071 /Lib/test | |
parent | 14ef54cd833c7ccfa0b3d03e2b45074d54a8ac87 (diff) | |
download | cpython-341deb74e7ec78eaf99838669ce04871e9f15783.zip cpython-341deb74e7ec78eaf99838669ce04871e9f15783.tar.gz cpython-341deb74e7ec78eaf99838669ce04871e9f15783.tar.bz2 |
The previous made the stop argument optional.
It is better to be explicit and just allow stop to be None.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_itertools.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/test/test_itertools.py b/Lib/test/test_itertools.py index d0b1ce8..ef2ab26 100644 --- a/Lib/test/test_itertools.py +++ b/Lib/test/test_itertools.py @@ -78,12 +78,12 @@ class TestBasicOps(unittest.TestCase): self.assertEqual(list(islice(xrange(100), *args)), range(*tgtargs)) # Test stop=None - self.assertEqual(list(islice(xrange(10))), range(10)) self.assertEqual(list(islice(xrange(10), None)), range(10)) self.assertEqual(list(islice(xrange(10), 2, None)), range(2, 10)) self.assertEqual(list(islice(xrange(10), 1, None, 2)), range(1, 10, 2)) # Test invalid arguments + self.assertRaises(TypeError, islice, xrange(10)) self.assertRaises(TypeError, islice, xrange(10), 1, 2, 3, 4) self.assertRaises(ValueError, islice, xrange(10), -5, 10, 1) self.assertRaises(ValueError, islice, xrange(10), 1, -5, -1) |