Python's random: What happens if I don't use seed(someValue)?
"Use the Source, Luke!"...;-). Studying https://svn.python.org/projects/python/trunk/Lib/random.py will rapidly reassure you;-).
What happens when seed isn't set (that's the "i is None" case):
if a is None:
try:
a = long(_hexlify(_urandom(16)), 16)
except NotImplementedError:
import time
a = long(time.time() * 256) # use fractional seconds
and the expovariate:
random = self.random
u = random()
while u <= 1e-7:
u = random()
return -_log(u)/lambd
obviously uses the same underlying random generator as every other method, and so is identically affected by the seeding or lack thereof (really, how else would it have been done?-)
a) It typically uses the system clock, the clock on some systems may only have ms precision and so seed twice very quickly may result in the same value.
seed(self, a=None) Initialize internal state from hashable object.
None or no argument seeds from current time or from an operating system specific randomness source if available.
http://pydoc.org/2.5.1/random.html#Random-seed
b) I would imagine expovariate does, but I can't find any proof. It would be silly if it didn't.
current system time is used; current system time is also used to initialize the generator when the module is first imported. If randomness sources are provided by the operating system, they are used instead of the system time (see the os.urandom() function for details on availability).
Random Docs