combinations, partitions functions should return iterators #3989

Closed
stevengj opened this Issue Aug 8, 2013 · 8 comments

Comments

Projects
None yet
4 participants
Owner

stevengj commented Aug 8, 2013

See this mailing-list discussion.

As @StefanKarpinski notes, the combinations function should really return an Iterator type; the task-based interface was doubtless easier to implement but is harder to use.

Furthermore, it looks like we have a little ways to go in order to beat the CPython itertools.combinations function.

Owner

StefanKarpinski commented Aug 8, 2013

The partitions function should likewise be improved. We probably want iterable permutations and subsets functions as well.

@JeffBezanson JeffBezanson added a commit that referenced this issue Aug 8, 2013

@JeffBezanson JeffBezanson Combinations iterator, for #3989
based on code by @kmsquire
b427368
Owner

JeffBezanson commented Aug 8, 2013

Now we are significantly faster.

Owner

stevengj commented Aug 8, 2013

Nice! But a hornéd hat of shame for not updating the documentation...

Owner

JeffBezanson commented Aug 8, 2013

drat. thanks for the reminder.

Owner

stevengj commented Aug 13, 2013

Is this now done? Can we close the issue and add a NEWS item?

Owner

JeffBezanson commented Aug 14, 2013

The integer and set partitions functions haven't been converted yet.

Member

kmsquire commented Aug 14, 2013

I should be submittiing these in a few minutes.

Owner

JeffBezanson commented Aug 14, 2013

Kevin you're a beast!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment