Question
How to explicitly list allowed keyword arguments in python for IDE support?
I'm using
argparse.ArgumentParser
in python and giving users the option to add their own functions to my script. For that, I'm giving them a function that generates data that gets used in argparse's
add_argument()
function. I noticed that add_argument's signature is
add_argument(self, *args, **kwargs)
but when looking at the documentation in vscode I can see all the different arguments it can get (action, nargs, const, default, etc.).
How does python do it? As far as I know when you give the user **kwargs
it is shown as **kwargs
and that's it.
I looked all over this site and the internet in general but I can't find the syntax used for it.