class Parent(object):
def method(self, a, b, c):
return a ** c + b ** c
class Child(Parent):
def method(self, a, b):
return super().method(a, b, 3)
p = Parent()
c = Child()
print(p.method(2, 5, 1), c.method(2, 5))
Signature of method 'Child.method()' does not match signature of base method in class 'Parent'.
This inspection detects inconsistencies in overriding method signatures.
def method(a, b, c=3):
return a ** c + b ** c
print(method(2, 5, 1), method(2, 5))
class Parent(object):
def method(self, a, b, c):
return a ** c + b ** c
class Child():
def method(self, a, b):
return Parent.method(a, b, 3)