Project

General

Profile

« Previous | Next » 

Revision 1871

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.

View differences:

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