I ran into a bit of a problem, trying to use the new-style class syntax while calling a class that apparently only supports the old-class style syntax (thanks due to Brend on #python at irc.freenode.net for pointing that out). Look closely at the call to super() in the following code:
#!/usr/bin/python
# -*- set tabstop=4 -*-
import cgi
class CGIWrapper(cgi.FieldStorage):
def __init__(self):
super(CGIWrapper, self).__init__()
if __name__ == "__main__":
c = CGIWrapper()
---------Error----------------
Traceback (most recent call last):
File "yoyo.py", line 17, in ?
c = CGIWrapper()
File "yoyo.py", line 9, in __init__
super(CGIWrapper, self).__init__()
TypeError: super() argument 1 must be type, not classobj
The workaround, naturally, is to call cgi.FieldStorage using the old-class style way.
class CGIWrapper(cgi.FieldStorage):
def __init__(self):
cgi.FieldStorage.__init__(self)