def function(a: int, b: str) -> None:
pass
def wrapper(extra: int, *args, **kwargs) -> None:
do_something_with_extra(extra)
function(*args, **kwargs)
Is there an easy way for wrapper to inherit function()'s type hints without retyping all of them? Normally I'd write
def wrapper(extra: int, a: int, b: str) -> None:
But it becomes very verbose with a lot of arguments, and I have to update wrapper() every time I update function()'s arguments, and using *args, **kwargs
means there won't be proper autocomplete in vscode and other editors.