(cls, /, **kwargs)
Control how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
Control how subclasses generate random integers.
Control how subclasses generate random integers .
def __init_subclass__(cls, /, **kwargs):
        """Control how subclasses generate random integers.

        The algorithm a subclass can use depends on the random() and/or
        getrandbits() implementation available to it and determines
        whether it can generate random integers from arbitrarily large
        ranges.
        """

        for c in cls.__mro__:
            if '_randbelow' in c.__dict__:
                # just inherit it
                break
            if 'getrandbits' in c.__dict__:
                cls._randbelow = cls._randbelow_with_getrandbits
                break
            if 'random' in c.__dict__:
                cls._randbelow = cls._randbelow_without_getrandbits
                break
def __init_subclass__ ( cls , / , ** kwargs ) : for c in cls . __mro__ : if '_randbelow' in c . __dict__ : # just inherit it break if 'getrandbits' in c . __dict__ : cls . _randbelow = cls . _randbelow_with_getrandbits break if 'random' in c . __dict__ : cls . _randbelow = cls . _randbelow_without_getrandbits break