This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author javawizard
Recipients javawizard
Date 2014-05-02.07:39:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1399016381.86.0.358283967216.issue21414@psf.upfronthosting.co.za>
In-reply-to
Content
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.

Something like:

>>> list(itertools.intersperse(1, [2, 3, 4]))
[2, 1, 3, 1, 4]
History
Date User Action Args
2014-05-02 07:39:41javawizardsetrecipients: + javawizard
2014-05-02 07:39:41javawizardsetmessageid: <1399016381.86.0.358283967216.issue21414@psf.upfronthosting.co.za>
2014-05-02 07:39:41javawizardlinkissue21414 messages
2014-05-02 07:39:40javawizardcreate