I have a class B defined by multiple inheritance.
class A:
def __init__(self, x, y):
self.x = x
self.y = y
class AMixin:
def __init__(self, *args, **kwargs):
# do stuff
super().__init__(*args, **kwargs)
class B(AMixin, A):
pass
Basically the mixin class overrides the __init__ method, but from the point of view of users using class B, class B's signature is same as A.
Since I am using *args and **kwargs in the mixin class, then B's initialization is based on A's constructor (functionally).
However, linters won't know that and they would think that B's signature is args and kwargs, which is kind of unhelpful.
I think this is he same problem as letting inspect.signature return A's signature (instead of AMixin) when inspecting B, but now here is what I get when I inspect B:
from inspect import signature
signature(B).parameters.keys()
# odict_keys(['args', 'kwargs'])
How to make it return ['x', 'y'] instead?