Re: new itertools functions in Python 2.6

2008-07-18 Thread Mensanator
On Jul 16, 5:05 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Jul 16, 7:20 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > ## Combinations with replacement > > > > ## - > > > > ## aaa aab aac aad aae abb abc abd abe acc acd ace > > > > ## add ade aee bbb bbc

Re: new itertools functions in Python 2.6

2008-07-16 Thread Mark Dickinson
On Jul 16, 7:20 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > ##  Combinations with replacement > > > ##  - > > > ##  aaa aab aac aad aae abb abc abd abe acc acd ace > > > ##  add ade aee bbb bbc bbd bbe bcc bcd bce bdd bde > > > ##  bee ccc ccd cce cdd cde cee ddd dde

Re: new itertools functions in Python 2.6

2008-07-15 Thread Mensanator
On Jul 15, 1:44 am, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > On Jul 14, 1:26 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > ## Combinations with replacement > > ## - > > ## aaa aab aac aad aae abb abc abd abe acc acd ace > > ## add ade aee bbb bbc bbd bbe bcc

Re: new itertools functions in Python 2.6

2008-07-14 Thread Raymond Hettinger
On Jul 14, 1:26 pm, Mensanator <[EMAIL PROTECTED]> wrote: > ##  Combinations with replacement > ##  - > ##  aaa aab aac aad aae abb abc abd abe acc acd ace > ##  add ade aee bbb bbc bbd bbe bcc bcd bce bdd bde > ##  bee ccc ccd cce cdd cde cee ddd dde dee eee > ## > ##  

new itertools functions in Python 2.6

2008-07-14 Thread Mensanator
With the new functions added to itertools in Python 2.6, I can finally get rid of this monstrosity: def ooloop6(a, n, perm=True, repl=True): if (not repl) and (n>len(a)): return r0 = range(n) r1 = r0[1:] if perm and repl: # ok v = ','.join(['c%s' % i for i in r