id summary reporter owner description type status priority milestone component resolution keywords cc parents 552 GMGTableBase uses default kwarg of {} in methods nyergler nyergler "A few places in GMGTableBase have method definitions that look something like: {{{ def find_one(cls, query_dict={}): ... }}} This is almost certainly not what the authors intended. The default argument list is only evaluated once during execution, at import time. The code above creates a single dictionary as the default, and if this is mutated down the line, the mutated value becomes the default for subsequent calls. In these particular cases it's unlikely to cause problems -- that argument will almost certainly be passed in -- but in the event it's not, this can cause very strange, difficult to diagnose behavior. The correct approach is to use an immutable value as an argument default. Note that this same problem exists for class level attributes: defining a class such as: {{{ class Foo(object): bar = {} }}} means that for *every* instance of {{{Foo}}}, {{{self.bar}}} will point to the *same* dict." defect closed minor 0.3.2 programming fixed