On Jun 23, 2011, at 7:53 PM, Sven Marnach wrote:

I'd like to suggest what I consider a few minor improvements to
Python's random module.

You can create a feature request on the bug tracker and assign to me.


1. random.expovariate(lambd)

This seems reasonable

2. random.sample(population, k)

This may be a unnecessary optimization (not worth the complexity),
but I will look at it further.


3. random.choice(seq)

It could be generalized to arbitrary iterables (Bentley provides an example of how to do this) but it is fragile (i.e. falls apart badly with weak random number generators) and doesn't correspond well with real use cases.  


Raymond