[Zope-DB] Weird Python 2.3 subclassing thing with _mysql and MySQLdb

Chris Withers chris at simplistix.co.uk
Sat Apr 3 12:02:43 EST 2004


(cross posting to python list in case someone there can explain this bizarre 
behaviour...)

Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> import _mysql

...define kwargs...

 >>> c = _mysql.connection(**kwargs)
 >>> c
<_mysql.connection open to 'localhost' at 7b8858>
 >>> c.server_capabilities
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
AttributeError: server_capabilities

...hmmm, okay, so no server_capabilties attribute...

 >>> class test(_mysql.connection): pass
...
 >>> c = test(**kwargs)
 >>> c
<_mysql.connection open to 'localhost' at 82c2a0>
 >>> c.server_capabilities
8236

...BWAGGGHH?!

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk




More information about the Zope-DB mailing list