mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Update the itertools.accumulate() docs.
This commit is contained in:
parent
240f112448
commit
2d93e6ee63
2 changed files with 5 additions and 5 deletions
|
@ -66,6 +66,7 @@ class TestBasicOps(unittest.TestCase):
|
|||
self.assertEqual(
|
||||
list(accumulate(map(typ, range(10)))),
|
||||
list(map(typ, [0, 1, 3, 6, 10, 15, 21, 28, 36, 45])))
|
||||
self.assertEqual(list(accumulate('abc')), ['a', 'ab', 'abc']) # works with non-numeric
|
||||
self.assertEqual(list(accumulate([])), []) # empty iterable
|
||||
self.assertEqual(list(accumulate([7])), [7]) # iterable of length one
|
||||
self.assertRaises(TypeError, accumulate, range(10), 5) # too many args
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue