oddness in super()

Michael P. Soulier msoulier at digitaltorque.ca
Sat Jun 18 16:05:53 EDT 2005


Ok, this works in Python on Windows, but here on Linux, with Python 2.4.1, I'm
getting an error. 

The docs say:

A typical use for calling a cooperative superclass method is:

class C(B):
    def meth(self, arg):
        super(C, self).meth(arg)

However, when I try this, which works on windows, with ActiveState
ActivePython 2.4.0...

class RemGuiFrame(RemGlade.RemFrame):
    """This class is the top-level frame for the application."""

    def __init__(self, *args, **kwds):
        "Class constructor."
        # Constructor chaining
        super(RemGuiFrame, self).__init__(*args, **kwds)

...on linux I get this...

[msoulier at piglet pysrc]$ ./RemGui.py 
Traceback (most recent call last):
  File "./RemGui.py", line 206, in ?
    frame_1 = RemGuiFrame(None, -1, "")
  File "./RemGui.py", line 30, in __init__
    super(RemGuiFrame, self).__init__(*args, **kwds)
TypeError: super() argument 1 must be type, not classobj

Why the difference? Is Python portability overrated? Is this a bug?

I'm confused. 

Mike

-- 
Michael P. Soulier <msoulier at digitaltorque.ca>
http://www.digitaltorque.ca
http://opag.ca      python -c 'import this'
Jabber: msoulier at digitaltorque.ca
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20050618/3e8fb35e/attachment.sig>


More information about the Python-list mailing list