MySQLDb uses weak proxy to prevent circular dependencies between cursors and connections.
But you would expect from the documentation on weakref that you could still tests for equivalence. Yet:
In [36]: interactive.cursor.connection.thread_id()
Out[36]: 4267758
In [37]: interactive.web_logic.conns.primary.thread_id()
Out[37]: 4267758
In [38]: interactive.cursor.connection == interactive.web_logic.conns.primary
Out[38]: False
In [39]: interactive.cursor.connection
Out[39]: <weakproxy at 0x3881c60 to Connection at 0x94c010>
In [40]: interactive.web_logic.conns.primary
Out[40]: <_mysql.connection open to 'xendb01' at 94c010>
How do I tell if the connections are the same ?