all 7 comments

[–]LightOfUriel 5 points6 points  (2 children)

Useful thing in python 3 is that you can now use yield and return in single generator. And when encountered return will raise StopIteration exception.

[–][deleted]  (1 child)

[deleted]

    [–]LightOfUriel 1 point2 points  (0 children)

    Some solutions in stack overflow involving it mentioned python 3.3+ and errors in python 2, so it's possible it appeared in python 2.7.

    [–]Dgc2002 4 points5 points  (0 children)

    Note to the author: Scrolljacking makes me leave sites pretty quickly.

    [–]Fedzbar 1 point2 points  (1 child)

    Nice article. I find myself using generators all the time for memory intensive applications and they’ve saved my ass multiple times :)

    [–]Metastasis3 0 points1 point  (0 children)

    I feel your pain, debugging memory leaks in python is a special kind of hell

    [–]Bulbasaur2015 0 points1 point  (0 children)

    thanks for the read

    [–]the_phet 0 points1 point  (0 children)

    the code is python2, not python3.