sympy/sympy — pull request #1375 by smichr (2012-06-22 09:49:21+00:00)
Title: add _randint and _randrange generators to core.function

These generators accept None, int, or a sequence. The returned
generator is then called like random's version, e.g. _randint()(1,3)
and mostly the result is the same unless a sequence is sent. In that
case the elements of the sequence that satisfy the arguments given
will be returned, e.g. ri = _randint([1,5,2,3]); [ri(1,2) for i in range(2)]
would return [1, 2] and ignore the 5. Another call to ri(1,2) would generate
an error since there are no more valid elements.