primesUpTo = lambda N: (lambda table: [[table.__setitem__(mult, False) for
    mult in range(i ** 2, N, i)] for i in range(2, int(N ** 0.5) + 1) if
    table[i]] and [p for p in table if p][1:])(list(range(N)))
primesUpTo(30)
Python prime generator in one-line