I'm trying to get some code with a few ugly 'global' objects in python to be reduced to something a bit more modular. Sometimes code is clearer than words:
>>> def foo():
... print foo.a
>>> foo.a = 1
>>> foo.a = 2
In otherwords, I have some value I need persistent between function calls. However, there's only one function that needs that value. I can store it in the function itself, and have it available.
The only unfortunate tragedy is that code like this still fails epically:
>>> 0.15 * 6