Jun-17-2021, 10:25 AM
(This post was last modified: Jun-17-2021, 12:24 PM by AlekseyPython.)
Fedora 34, Python 3.9.5
from PyQt5 import QtWidgets
from PyQt5.QtWidgets import QWidget
class M_A(type(QWidget), type):pass
class A(QWidget, metaclass=M_A):
def __init__(self):
QWidget.__init__(self)
class B:
def __init__(self, controller):
self.controller = controller
class M_C(type(A), type(B)):pass
class C(A, B, metaclass=M_C):
def __init__(self, controller):
A.__init__(self)
B.__init__(self, controller)
app = QtWidgets.QApplication([])
C(controller=19)Error:Traceback (most recent call last):
File "/home/ivan/eclipse-workspace/GompertzLaw/Exp.py", line 22, in <module>
C(controller=19)
File "/home/ivan/eclipse-workspace/GompertzLaw/Exp.py", line 17, in __init__
A.__init__(self)
File "/home/ivan/eclipse-workspace/GompertzLaw/Exp.py", line 7, in __init__
QWidget.__init__(self)
TypeError: __init__() missing 1 required positional argument: 'controller'Where is the mistake?
