Problem subclassing Database class

christhemule at my-deja.com christhemule at my-deja.com
Tue Aug 29 14:39:03 EDT 2000


I'm trying to subclass the DB class in the PyGreSQL module with the
following code fragment:

class Database(DB):
    "Class providing a wrapper around the DB class in PyGreSQL"

    def __init__(self, *args, **kw):
        DB.__init__(self, args, kw)

  ...snip....

When trying to instatiate this class using:
cnx = data.Database("pythontest")

I get the following traTraceback (innermost last):
  File "<stdin>", line 1, in ?
  File "data.py", line 12, in __init__
    DB.__init__(self, args, kw)
  File "/usr/lib/python1.5/site-packages/pg.py", line 34, in __init__
    self.db = apply(connect, args, kw)
TypeError: argument 1: expected None or string, tuple found

I'm new to Python, and cannot see what I'm doing wrong.

Many Thanks
Chris Spence, Hartlepool, UK


Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list