Calling superclass

  • Thread starter Florian Lindner
  • Start date
F

Florian Lindner

Hello,
I try to call the superclass of the ConfigParser object:

class CustomizedConfParser(ConfigParser.SafeConfigParser):
def get(self, section, attribute):
try:
return super(CustomizedConfParser, self).get(section, attribute)
# [...]


but that gives only

return super(CustomizedConfParser, self).get(section, attribute)
TypeError: super() argument 1 must be type, not classobj

I don't really understand the error message.

Thanks,

Florian
 
D

Diez B. Roggisch

Florian said:
Hello,
I try to call the superclass of the ConfigParser object:

class CustomizedConfParser(ConfigParser.SafeConfigParser):
def get(self, section, attribute):
try:
return super(CustomizedConfParser, self).get(section,
attribute)
# [...]


but that gives only

return super(CustomizedConfParser, self).get(section, attribute)
TypeError: super() argument 1 must be type, not classobj

I don't really understand the error message.


super works only for newstyle-classes. So additionally extend
CustomizedConfParser from object.

diez
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top