Calling superclass

Diez B. Roggisch deets at nospam.web.de
Thu May 4 18:06:24 CEST 2006


Florian Lindner wrote:

> 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



More information about the Python-list mailing list