[Python-ideas] Fwd: Extremely weird itertools.permutations

Neil Girdhar mistersheik at gmail.com
Sun Oct 13 21:39:19 CEST 2013


On Sun, Oct 13, 2013 at 3:34 PM, Oscar Benjamin
<oscar.j.benjamin at gmail.com>wrote:

> 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.
>

The code solves the problem according to its specification :)  (The numbers
are less than 1e8.)


> > 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
>

The problem is a use-case.  Did you read it?  Did you try solving it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20131013/5516edb6/attachment.html>


More information about the Python-ideas mailing list