[Python-ideas] Extremely weird itertools.permutations
Ethan Furman
ethan at stoneleaf.us
Sun Oct 13 03:11:18 CEST 2013
On 10/12/2013 05:44 PM, Raymond Hettinger wrote:
>
> On Oct 12, 2013, at 11:56 AM, Neil Girdhar <mistersheik at gmail.com <mailto:mistersheik at gmail.com>> wrote:
>
>> , I find the current behaviour surprising and would like to see a distinct_permutations function.
>> How do I start to submit a patch?
>
> You can submit your patch at http://bugs.python.org and assign it to me (the module designer and maintainer).
>
> That said, the odds of it being accepted are slim.
+1
About the only improvement I can see would be a footnote in the itertools doc table that lists the different
combinatorics. Being a naive permutations user myself I would have made the mistake of thinking that "r-length tuples,
all possible orderings, no repeated elements" meant no repeated values. The longer text for permutations makes it clear
how it works.
My rst-foo is not good enough to link from the table down into the permutation text where the distinction is made clear.
If no one beats me to a proposed patch I'll see if I can figure it out.
--
~Ethan~
More information about the Python-ideas
mailing list