[issue27384] itertools islice consumes items when given negative range

2016-06-28 Thread Raymond Hettinger
Raymond Hettinger added the comment: "Surprising" is in the eye of the beholder. Having islice() always consume at least "start" number of values seems reasonable enough and it is the documented behavior: "If start is non-zero, then elements from the iterable are skipped until start is

[issue27384] itertools islice consumes items when given negative range

2016-06-24 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> rhettinger nosy: +rhettinger ___ Python tracker ___

[issue27384] itertools islice consumes items when given negative range

2016-06-24 Thread Matthew Malcomson
New submission from Matthew Malcomson: While the itertools.islice(iterator, n, n) trick is useful as used in the consume recipe, I find the current behaviour if stop is less than start (e.g. itertools.islice(iterator, 3, 0) ) to be surprising. It still consumes the first three elements of