Revision 1871
Added by Aaron Marcuse-Kubitza almost 13 years ago
lib/rand.py | ||
---|---|---|
1 | 1 |
# Random numbers |
2 | 2 |
|
3 |
def rand_int(): return id(object()) |
|
3 |
import sys |
|
4 |
import random |
|
5 |
|
|
6 |
def rand_int(): |
|
7 |
return random.randint(0, sys.maxint) |
Also available in: Unified diff
rand.py: rand_int() Fixed bug where newly-created objects did not have unique IDs because they were on the stack. So, we have to use random.randint() anyway.