0

I'm subclassing a class that I made, and in the subclass I'm overriding a method of the parent class. For this particular method the linter complains about mismatch in signatures between this implementation and the implementation of the base method. In many other methods I don't see it complaining even though there's mismatch, what's the catch? and why is it good to match the signatures?

enter image description here

Alex Deft
  • 2,531
  • 1
  • 19
  • 34

1 Answers1

3

I've seen this before too. Assuming you don't want them to match, e.g. you're extending the params the method takes, then you can just ignore or suppress this warning. I think it's there to try to warn you that you might have code that's incompatible but IMO it's not very helpful in most cases.

See also Python Method overriding, does signature matter? for a decent explanation of why the warning might be useful.

Tom Dalton
  • 6,122
  • 24
  • 35