I have been trying to solve a question that I have been running into, which is how to type hint a functions arguments that has passed *args, **kwargs
within another function call
Example:
def func_b(arg_b):
"""
:param arg_b: Argument B
"""
print(arg_b)
def func_a(arg_a, *args, **kwargs):
"""
:param arg_a: Argument A
"""
print(arg_a)
func_b(*args, **kwargs)
# If hovering above func-a arg_b is not shown sa an possible argument
func_a(arg_a="", arg_b="")
In the example shown, when hovering mouse above func_a
in pycharm or just trying to type arg_b
it does not show arg_b
as an valid argument.
How is it possible to make it possible to both see the func_a
and func_b
when typing arguments for the function func_a
arguments?
I read a bit in the post Type annotations for *args and **kwargs post but it did no really fit my use case