Code with random module faster on the vm than the vm host...

alex23 wuwei23 at gmail.com
Sun Nov 10 21:16:10 EST 2013


On 11/11/2013 11:19 AM, Robert Kern wrote:
> On 2013-11-11 00:49, alex23 wrote:
>> The random module uses os.urandom,
>
> No, it doesn't. random.random() is an alias to the random() method on
> the random.Random class, which uses the Mersenne Twister to generate
> values. os.urandom() gets called in the initial default seeding, but not
> for each value.

That's what I get for rapidly skimming the module rather than looking at 
it carefully.

Cheers.




More information about the Python-list mailing list