Note to self.self: List comprehensions in Python 2.x leak!

After considerable amount of debugging on some code I've been writing in Python 2.x I finally found the bug. This time it didn't arise because I was sloppy, as it so often does, but because of faulty behaviour intrinsic to the language design of Python 2.x itself.

Leaking bucket

A simple example shows the bug...

It's no surprise that others have encountered this bug/feature before and it has supposedly been fixed in Python 3.x.

Maybe this is a good example of why I should be switching over to Python 3.x soon... ish...