<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 23, 2011, at 7:53 PM, Sven Marnach wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>I'd like to suggest what I consider a few minor improvements to<br>Python's random module.<br></div></blockquote><div><br></div><div>You can create a feature request on the bug tracker and assign to me.</div><br><blockquote type="cite"><div><br>1. random.expovariate(lambd)<br></div></blockquote><div><br></div><div>This seems reasonable</div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000"><br></font>2. random.sample(population, k)<br></div></blockquote><div><br></div>This may be a unnecessary optimization (not worth the complexity),</div><div>but I will look at it further.<br><div><br></div><blockquote type="cite"><div><br>3. random.choice(seq)<br></div></blockquote><div><br></div>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. <br><div><br></div><div><br></div><div>Raymond</div></div></body></html>