Python Forum
[Python Core] Keyword for direct passthrough of **kwargs to super().__init__
Thread Rating:
  • 1 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Python Core] Keyword for direct passthrough of **kwargs to super().__init__
#3
(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.
Reply


Messages In This Thread
RE: [Python Core] Keyword for direct passthrough of **kwargs to super().__init__ - by miallo - May-25-2018, 05:30 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020