[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread Tim Peters
Changes by Tim Peters : -- resolution: -> rejected stage: -> resolved ___ Python tracker ___

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread YoSTEALTH
YoSTEALTH added the comment: Tim, I get what you are saying good point. -- status: open -> closed ___ Python tracker ___

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread Tim Peters
Tim Peters added the comment: Note that "iterable" covers a world of things that may not support indexing (let alone slicing). For example, it may be a generator, or a file open for reading. -- nosy: +tim.peters ___ Python tracker

[issue27751] Itertools -> Recipes -> pairwise()

2016-08-12 Thread YoSTEALTH
New submission from YoSTEALTH: # Link: https://docs.python.org/3/library/itertools.html#itertools-recipes # Function pairwise() in Itertools -> Recipes could be improved!? Here is the code: import time import itertools def pairwise(iterable): "s -> (s0,s1), (s1,s2), (s2, s3), ..."