Oct. 14, 2013
5:56 p.m.
On Oct 13, 2013, at 1:56 PM, Neil Girdhar <mistersheik@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