Interesting little "gotcha" with generators

Paul Rubin http
Thu Dec 22 23:31:29 CET 2005


aahz at pythoncraft.com (Aahz) writes:
> What's wrong with
> 
>     def foo():
>         if False: yield None

Does the following work?

    def foo():
        raise StopIteration



More information about the Python-list mailing list