import itertools


def bruteforce(charset, minlength, maxlength):
    """Efficient dumb bruteforcer generator.

    Example:
        # Generate every string 3 to 10 characters long, from the ascii_lowercase charset.
        for word in bruteforce(string.ascii_lowercase, 3, 10):
            print(word)
    """
    return (''.join(candidate)
        for candidate in itertools.chain.from_iterable(itertools.product(charset, repeat=i)
        for i in range(minlength, maxlength + 1)))