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__
#4
(May-25-2018, 05:30 PM)miallo Wrote: 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.
sorry, this was not clear from your original question. At least I didn't understood your question as such - that's why I moved it to General Coding Help. If it is regarding [desired] future functionality - than indeed News and Discussions is more appropriate. I will return it there now.
(May-25-2018, 05:30 PM)miallo Wrote: 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.
you are free to have all keywords you want explicitly mentioned, and then have **kwargs as catch all for all that are irrelevant and simply ignore them... (that is my second example)
And it will throw error because it's not a keyword argument, but dict of keyword arguments.
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


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

Forum Jump:

User Panel Messages

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