Re:What if SMTP and Sinatra Had a Baby?
by pyre on Sunday November 27, 2011 @01:11AM
(#3281846)
def __init__(self, ..., foo={}):
self.foo = foo
In this case, 'foo={}' is evaluated once, and returns a pointer to a dict(). After that, foo is always pointing to the same dict, not to a newly created empty dict.
Run this in a Python interpreter:
The only thing that is really safe to put in the defaults are immutable values.