May-25-2018, 05:30 PM
(May-25-2018, 05:17 PM)buran Wrote: well, *args is catch all for positional arguments, **kwargs - for keyword (named) argument, so there is no way to have one more catch-all-pass-trough.
I know that it is not possible with the current version of python. What I was asking is, if it would be possible to implement something like this for future versions of Python.
I want the autocomplete and all the automatically generated docstrings to be as easy to understand as possible. I want something that signals a docstring generator "Hey, this class can in principle take **kwargs as an input, but it just passes them to their super class without doing anything to them. So for this class: just ignore them".
If a user types
Animal(
I want the IDE to show just Animal(species)
and not some obscure Animal(species, **kwargs)
because when you create an instance of this class yourself you never need to input any kwargs as they would throw an error if you did so anyways.