[Python-ideas] Extremely weird itertools.permutations
Neil Girdhar
mistersheik at gmail.com
Fri Oct 11 20:38:33 CEST 2013
"It is universally agreed that a list of n distinct symbols has n!
permutations. However, when the symbols are not distinct, the most common
convention, in mathematics and elsewhere, seems to be to count only
distinct permutations." —
http://stackoverflow.com/questions/6534430/why-does-pythons-itertools-permutations-contain-duplicates-when-the-original.
Should we consider fixing itertools.permutations and to output only unique
permutations (if possible, although I realize that would break code). It is
completely non-obvious to have permutations returning duplicates. For a
non-breaking compromise what about adding a flag?
Best,
Neil
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131011/c27bd95d/attachment-0001.html>
More information about the Python-ideas
mailing list