Python newbie here. So I'm reading Whirlwind Tour of Python
and there is an example:
def gen_primes(N):
"""Generate primes up to N"""
primes = set()
for n in range(2, N):
if all(n % p > 0 for p in primes):
primes.add(n)
yield n
print(*gen_primes(100))
for this line: if all(n%p>0 for p in primes), I suppose primes is still empty, why for loop still working?
