Re: [Python-Dev] Additional behaviour for itertools.combinations

2009-01-25 Thread Steven D'Aprano
On Sun, 25 Jan 2009 02:33:37 pm Raymond Hettinger wrote: > > Raymond Hettinger wrote: > >> Since I expect students to be among the users for the comb/perm > >> functions, there is some merit to keeping the API as simple as > >> possible. Besides, it is not hard to use the existing tool as a > >> p

Re: [Python-Dev] Additional behaviour for itertools.combinations

2009-01-24 Thread Raymond Hettinger
Raymond Hettinger wrote: Since I expect students to be among the users for the comb/perm functions, there is some merit to keeping the API as simple as possible. Besides, it is not hard to use the existing tool as a primitive to get to the one you want: def mycombinations(iterable, r_seq):

Re: [Python-Dev] Additional behaviour for itertools.combinations

2009-01-24 Thread Nick Coghlan
Raymond Hettinger wrote: > Since I expect students to be among the users for the comb/perm > functions, there is some merit to keeping the API as simple as possible. > Besides, it is not hard to use the existing tool as a primitive to get to > the one you want: > > def mycombinations(iterable,

Re: [Python-Dev] Additional behaviour for itertools.combinations

2009-01-24 Thread Raymond Hettinger
From: "Konrad Delong" I'm not sure if it's the right place to post it. If so - I'll be glad to learn where is one. Please post a feature request on the bug tracker and assign it to me. Anyway: I think the function itertools.combinations would benefit from making the 'r' (length of the combi

[Python-Dev] Additional behaviour for itertools.combinations

2009-01-24 Thread Konrad Delong
I'm not sure if it's the right place to post it. If so - I'll be glad to learn where is one. Anyway: I think the function itertools.combinations would benefit from making the 'r' (length of the combinations) argument optionally a sequence. With that change one could call combinations(sequence, [2,