In python when creating a subclass we often pass necessary arguments to the superclass using the construction super().__init__(*args, **kwargs)
like so:
class B(A):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
However, if I do this I will lose all argument hints and docstrings from superclass (A in this case) and will be left with *args
and **kwargs
.
When using decorators a similar problem is solved via functools.wraps
. My question is is there similarly elegant solution to the situation with __init__
of a subclass? Maybe using functools.update_wrapper
?