def primes_to(num):
    """primes_to(...) --> list

	Return a list of all the primes up to a number"""
    if num < 2:
        return []
    primes = []
    for odd in range(3, int(num + 1), 2):
        for prime in primes:
            if odd % prime == 0:
                break
        else:
            primes.append(odd)
    return [2] + primes
