News for hackers. Stuff that matters.
Re:Python Generators in Depth by beagle3 on Wednesday February 27, 2013 @12:13AM (#5290793)
You use "assert gen.next() is None", but asserts might be dropped by optimizations, see e.g. http://docs.python.org/release/2.5.2/ref/assert.html - and your code will break.

assert should only be used for debugging, and only for things that should never happen. side effects on assert is a no-no. (Also in C)

There are no comments on this comment yet.