What does the following segment do - Pyhon : I have a problem with the following function.. I can't understand what it does, because I'm new to Python, can you help me, please. Thanks in advance.

    def foo(limit):
        a = [True] * limit
        a[0] = a[1] = False
        for (i,b) in enumerate(a):
            if b:
            yield i
            for n in xrange(i*i,limit,i):
                a[n] = False
                