On Mon, Sep 27, 2010 at 3:02 PM, Vicente Sole <s...@esrf.fr> wrote:
> Hi Gerard,
>
> Quoting Gerard Vermeulen <gav...@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
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to