I missed this trick a while back, but for everyone who has to program in Python and misses actual working closures, close over a container variable or use a function attribute. jjlinuxland’s Modifying a Counter in a Closure and the comments explain more.

Now to play with lambda to see if this trick makes them more useful….