Message314835
If you're going to tackle this problem, this should probably be solved for the general case of n <= 0 rather than just n == 0.
In [1]: import random
In [2]: class Random(random.Random):
...: def random(self):
...: return super().random()
...:
In [3]: r = Random()
In [4]: r._randbelow(-1) # Should raise a ValueError
Out[4]: 0
But honestly, if someone is going to override ``random`` I think we can expect them to realize they're stepping into the deep end. |
|
Date |
User |
Action |
Args |
2018-04-02 22:33:36 | selik | set | recipients:
+ selik, rhettinger, serhiy.storchaka, wolma |
2018-04-02 22:33:36 | selik | set | messageid: <1522708416.49.0.467229070634.issue33203@psf.upfronthosting.co.za> |
2018-04-02 22:33:36 | selik | link | issue33203 messages |
2018-04-02 22:33:36 | selik | create | |
|