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
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.
Changes by Chris Rebert pyb...@rebertia.com:
--
nosy: +cvrebert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21414
___
___
Python-bugs-list
É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
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
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