vary number of loops

nullgraph at gmail.com nullgraph at gmail.com
Wed Apr 16 17:26:09 EDT 2008


On Apr 16, 10:12 am, "Reedick, Andrew" <jr9... at ATT.COM> wrote:
> > -----Original Message-----
> > From: python-list-bounces+jr9445=att.... at python.org [mailto:python-
> > list-bounces+jr9445=att.... at python.org] On Behalf Of Tim Chase
> > Sent: Wednesday, April 16, 2008 9:53 AM
> > To: nullgr... at gmail.com
> > Cc: python-l... at python.org
> > Subject: Re: vary number of loops
>
> > > If n=3, I want to have 3 sets of elements and mix them up using 3
> for
> > > loops.
>
> > You might be ineterested in this thread:
>
> >http://mail.python.org/pipermail/python-list/2008-January/473650.html
>
> > where various solutions were proposed and their various merits
> > evaluated.
>
> I second that.  The thread compared building loops on the fly, building
> comprehensions nested to arbitrarily levels, recursion (sloooow!), a
> slick cookbook recipe using iterators, etc. and provided timings for
> each method.  Definitely worth bookmarking.
>


Yes, I second that second :) Very nice thread, I'm leaning toward the
"pythonic method" from there, but thanks for all the other solutions
suggested here. Guess I need to go play with lambda more...

nullgraph



More information about the Python-list mailing list