Michael Selik <m...@selik.org> added the comment: 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. ---------- nosy: +selik _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33203> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com