deriving MySQLdb class

tekion tekion at gmail.com
Fri Jan 22 02:48:36 CET 2010


All,
I am trying to write a class which inherits from MySQLdb class.  Below
is code snippet:
import MySQLdb
import sys

class  msql_connect(MySQLdb):
    def __init__(self):
        self.host     =  "hostname"
        self.user     = "user"
        self.password  = "passoword"
        self.database = "database name"

I am running into below error:
 class  msql_connect(MySQLdb):
TypeError: Error when calling the metaclass bases
    module.__init__() takes at most 2 arguments (3 given)


Does any one have an idea why?  Thanks.



More information about the Python-list mailing list