In response to my question, ``What is the idiomatically appropriate
Python way to pass, as a "function-type parameter", code that is most
clearly written with a local variable?'', a number of you made very
helpful suggestions, including the use of a default argument; if one
wanted to give a name to
Subject: Re: random shuffles
To: python-list@python.org
Ross Ridge wrote:
> David G. Wonnacott wrote:
> > Couldn't we easily get an n*log(n) shuffle...
>
> Why are you trying to get an O(n*log(n)) shuffle when an O(n) shuffle
> algorithim is well known
From: "danielx" <[EMAIL PROTECTED]>
Date: 22 Jul 2006 01:43:30 -0700
Boris Borcic wrote:
> does
>
> x.sort(cmp = lambda x,y : cmp(random.random(),0.5))
>
> pick a random shuffle of x with uniform distribution ?
...
Let e be the element which was in the first position t
Many thanks to those of you who responded to my question about
anonymous functions with local variables, filling me in on
e) do something else clever and Pythonic that I don't know about yet?
by pointing out that I can use (among other good things) lambda with
default arguments. That should sui