Francesco Guerrieri wrote: > On Jan 11, 2008 6:20 PM, John Nagle <[EMAIL PROTECTED]> wrote: >> Tried: >> print item.dir() >> got: >> 'cell' object has no attribute 'dir'
It's a problem inside MySQLdb's "connections.py": def _get_unicode_literal(): def unicode_literal(u, dummy=None): return db.literal(u.encode(unicode_literal.charset)) return unicode_literal Each time a MySQLdb Connection object is created, it generates a closure, with another instance of the function "unicode_literal" plus some other junk. That generates circular references. Eventually those things get garbage-collected, but if you're running GC in leak detection mode, they show up. The reason for the closure is that "unicode_literal.charset" of the function is being stored into from outside the function. So there actually is a reason to use a closure. John Nagle -- http://mail.python.org/mailman/listinfo/python-list