The sliced(seq, n) function in more itertools silently returns wrong results when n is negative, instead of…
The sliced(seq, n) function in more itertools silently returns wrong results when n is negative, instead of…: a task in repo2rlenv-swe-gen (Harbor dataset). For example: python from more itertools import sliced list(sliced('ABCDEFG', -1)) 'ABCDEF' wrong — should raise ValueError list(sliced( 1, 2…
The task
For example: ```python >>> from more_itertools import sliced >>> list(sliced('ABCDEFG', -1)) ['ABCDEF'] # wrong — should raise ValueError >>> list(sliced([1, 2, 3, 4, 5], -2)) [[1, 2, 3]] # wrong — should raise ValueError ```
Part of FineEnvs/repo2rlenv-swe-gen.