[PyQt] Bug in sip-4.11.1 and PyQt-4.7.7 ?

Darren Dale dsdale24 at gmail.com
Mon Sep 27 20:17:35 BST 2010


On Mon, Sep 27, 2010 at 3:02 PM, Vicente Sole <sole at esrf.fr> wrote:
> Hi Gerard,
>
> Quoting Gerard Vermeulen <gav451 at gmail.com>:
>
>>  Phil,
>>
>> when running the following code
>>
>> #!/usr/bin/env python
>> # -*- coding: utf-8 -*-
>>
>> import PyQt4.Qt as Qt
>>
>> class MyWidget(Qt.QWidget):
>>
>>    def __init__(self, parent=None):
>>        super(Qt.QWidget, self).__init__(parent)
>>
>
> Just for my information, what is the difference between:
>
> super(Qt.QWidget, self).__init__(parent)
>
> and:
>
> Qt.QWidget.__init__(self, parent)

The example should have read: "super(MyWidget,
self).__init__(parent)", not "super(Qt.QWidget,
self).__init__(parent)". In this example, there is no difference
between the two syntaxes, but in cases involving multiple inheritance,
super() returns a proxy that delegates calls to the appropriate
superclass, as determined by the method resolution order. More here:
http://docs.python.org/library/functions.html#super

Darren


More information about the PyQt mailing list