#!/usr/bin/python

import itertools

#lines: Prime numbers sieve w/fancy generators
def iter_primes():
     numbers = itertools.count(2)
     while True:
         prime = numbers.next()
         yield prime
         numbers = itertools.ifilter(prime.__rmod__, numbers)

for p in iter_primes():
    if p > 500:
        break
    print p

fc0a5095c7f20f9bff5de1c582d3acbcb8b279bd
#!/usr/bin/python

import itertools

#lines: Prime numbers sieve w/fancy generators
def iter_primes():
     numbers = itertools.count(2)
     while True:
         prime = numbers.next()
         yield prime
         numbers = itertools.ifilter(prime.__rmod__, numbers)

for p in iter_primes():
    if p > 500:
        break
    print p
