[issue21414] Add an intersperse function to itertools

2014-05-03 Thread Raymond Hettinger
Raymond Hettinger added the comment: I've looked into this a bit more. Even in Haskell, it seems that use case is for str.join() which we already have. I don't see intersperse() in any other functional languages. That suggests that its use cases aren't sufficiently common to warrant adding

[issue21414] Add an intersperse function to itertools

2014-05-02 Thread Alexander Boyd
New submission from Alexander Boyd: Itertools would benefit greatly from a function (which I've named intersperse, after Haskell's equivalent) for yielding the items of an iterator with a given value placed between each. Sort of a str.join-like function, but for arbitrary sequences.

[issue21414] Add an intersperse function to itertools

2014-05-02 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21414 ___ ___ Python-bugs-list

[issue21414] Add an intersperse function to itertools

2014-05-02 Thread Éric Araujo
Éric Araujo added the comment: I looked for a previous discussion of this on the Python mailing lists and found nothing. Existing solutions include https://twitter.com/snim2/status/393821419114483712 and

[issue21414] Add an intersperse function to itertools

2014-05-02 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21414 ___ ___ Python-bugs-list

[issue21414] Add an intersperse function to itertools

2014-05-02 Thread Raymond Hettinger
Raymond Hettinger added the comment: What is the use case for interspersing values? I've not run across anything like it ever before. -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21414