[Python-ideas] Extremely weird itertools.permutations
Raymond Hettinger
raymond.hettinger at gmail.com
Mon Oct 14 19:56:23 CEST 2013
On Oct 13, 2013, at 1:56 PM, Neil Girdhar <mistersheik at gmail.com> wrote:
> I'm now convinced that itertools.permutations is fine as it is. I am not totally convinced that multiset_permutations doesn't belong in itertools,
Now that we have a good algorithm, I'm open to adding this to itertools,
but it would need to have a name that didn't create any confusion
with respect to the existing tools, perhaps something like:
anagrams(population, r)
Return an iterator over a all distinct r-length permutations
of the population.
Unlike permutations(), element uniqueness is determined
by value rather than by position. Also, anagrams() makes
no guarantees about the order the tuples are generated.
Raymond
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131014/256705e9/attachment.html>
More information about the Python-ideas
mailing list