Using super()

Carl Banks pavlovevidence at gmail.com
Wed Jul 19 15:29:40 EDT 2006


Pupeno wrote:
> I see, thank you.
>
> class MyConfig(ConfigParser, object):
>     def add_section(self, section)
>          super(MyConfig, self).add_section(section)
>
> seems to work and as expected. Is there anything wrong with it ?

Wow.

I highly recommend not doing this, unless the new type system was
designed to allow this sort of mixing, which I highly doubt.  There are
some significant under-the-cover differences between old- and new-style
classes that could mess everything up when trying to mix them.


Carl Banks




More information about the Python-list mailing list