The code shows a fast prime number generator using a sieve algorithm. It looks at only odd numbers. Technically 1 and 2 are prime numbers too, since they are only divisible by unity and themselves, exceptions are made for 1 and 2. Zero and negative numbers return an empty list.
The official definition for a prime number is any natural number [B]greater than 1[/B] that has the two divisors 1 and itself. So, we are leaving the 1 out!
This is not a generator object in the Python sense. It is a function that generates a list of prime numbers.
Note: see modified/corrected code at:
For much improved speed see ...