Let's say I have a class written in Python like this:
class Foo(object):
"""My fake class"""
def mymethod(self, first_arg):
"""original method"""
pass
Now let's say I define a new class that extends the previous one and I want to override mymethod
:
class Bar(Foo):
"""My new class"""
def mymethod(self, first_arg, second_arg):
"""overridden method"""
return first_arg == second_arg
Is it a bad practice to change the number of arguments in the overridden method?
EDIT:
Is there any official "good practice" rule about this? I just saw that if you do something like this in pydev you get a warning, so I suppose there should be something "official".