[Python-ideas] Fwd: Extremely weird itertools.permutations
Oscar Benjamin
oscar.j.benjamin at gmail.com
Sun Oct 13 21:34:09 CEST 2013
On 13 October 2013 19:29, Neil Girdhar <mistersheik at gmail.com> wrote:
> Did you read the problem?
I did but since you showed some code that you said you were working on
I thought you'd be interested to know that it could be improved.
> Anyway, let's not get off topic (permutations).
Getting back to your proposal, I disagree that permutations should be
"fixed". The current behaviour is correct. If I was asked to define a
permutation I would have given definition #3 from Steven's list: a
bijection from a set to itself. Formally a permutation of a collection
of non-unique elements is not defined.
They may also be uses for a function like the one that you proposed
but I've never needed it (and I have used permutations a few times)
and no one in this thread (including you) has given a use-case for
this.
Oscar
More information about the Python-ideas
mailing list