def sieve(n):
    if n < 2:
        return []
    not_prime = set()
    prime = [2]
    for i in range(3, n+1, 2):
        if i not in not_prime:
            prime.append(i)
            not_prime.update(range(i*i, n+1, i))
    return prime

@@ -15,35 +15,101 @@
     
-if n %3C 2:%0A        return %5B%5D
+return list(primes(n))%0A%0A%0Adef primes(n):%0A    if n %3C 2:%0A        raise StopIteration%0A    yield 2
 %0A   
@@ -131,24 +131,8 @@
 t()%0A
-    prime = %5B2%5D%0A
     
@@ -193,36 +193,8 @@
 me:%0A
-            prime.append(i)%0A
     
@@ -246,17 +246,20 @@
     
-return prime
+        yield i
 %0A

Revert back to a generator - it's actually slight faster