Я столкнулся с сообщением «RuntimeError: super(): нет аргументов» в версии Python 3.11. Я использую PyCharm в качестве консоли для кодирования. Может ли кто-нибудь помочь мне решить приведенный ниже код:
class Parent:
def __init__(self):
print("This is a parenet class constructor.")
def method_p1(self):
print("This is an parent instance method.")
@classmethod
def method_p2_class(cls):
print("This is a parent class method.")
@staticmethod
def method_p2_static():
print("This is a parent static method.")
class Child(Parent):
def __init__(self):
super().__init__()
print("This is a child class constructor.")
def method_c1(self):
print("This is a child class instance method.")
super().method_p1()
child_obj = Child()
child_obj.method_p1()
Error Output : super().method_p1()
^^^^^^^
RuntimeError: super(): no arguments
Подробнее здесь: https://stackoverflow.com/questions/785 ... -arguments
Метод SUPER() в Python 3.11 — «Ошибка выполнения: super(): нет аргументов» ⇐ Python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение