[Python-ideas] Possible new itertool: comm()

Paul Moore p.f.moore at gmail.com
Tue Jan 6 19:40:40 CET 2015


On 6 January 2015 at 18:00, Steven D'Aprano <steve at pearwood.info> wrote:
> But for what it's worth, here's my implementation which I
> think is easier to understand than yours,

Possibly - it's a trade-off between using a sentinel vs explicitly
catching the exceptions. I'm on the fence, personally.

> and covers the unfortunate
> case where you have unorderable items such as float NANs in your data.

Technically I don't think this is possible, as the input iterators
need to be sorted, and that property will be violated if there are
unorderable items in there...

Paul


More information about the Python-ideas mailing list