Sampling with weighted probabilities
Allow native iteration

It is reasonable to expect to be able to iterate over a RandomGen[erator], but the built-in for loop fails right now.

All you need to allow looping with a standard for loop is renaming next_num to __iter__

Use native iteration

    num = 0
    while num &lt; i:
        # ... snip ...
        num += 1


Is not nice, you are manually incrementing a counter in a high level language. Just use (x)range (depending on the Python version):

for num in range(i):
    # ... snip ...