Feature
Imagine this file with implementation:
classA:
defdo_some(self) ->None:
print('A')
classB(A):
defdo_some(self) ->None:
print('B')Auto-stub creators will create a stub like:
classA:
defdo_some(self) ->None: ...
classB(A):
defdo_some(self) ->None: ...
Which technically is right, but not quite.
Since do_some has the same signature in both A and B (only runtime implementation is different), we don't actually need it to be duplicated. We should ideally want just:
classA:
defdo_some(self) ->None: ...
classB(A): ...
Because we always want minimal correct stubs.
But, right now we only do this by hand.
Pitch
I propose adding --warn-needless-override options (with whatever name) that can warn us about needless overrides of parent methods in child classes.
I will send a PR with the initial imlementation.
Feature
Imagine this file with implementation:
Auto-stub creators will create a stub like:
Which technically is right, but not quite.
Since
do_somehas the same signature in bothAandB(only runtime implementation is different), we don't actually need it to be duplicated. We should ideally want just:Because we always want minimal correct stubs.
But, right now we only do this by hand.
Pitch
I propose adding
--warn-needless-overrideoptions (with whatever name) that can warn us about needless overrides of parent methods in child classes.I will send a PR with the initial imlementation.