Skip to content

Expose function args from high order function #7910

Answered by erictraut
Tomperez98 asked this question in Q&A
Discussion options

You must be logged in to vote

I don't know what you mean by "get the type annotations for the name argument".

If you want run to accept arguments that it can pass to fn, you need to include *args and **kwargs parameters like this:

def run(fn: Callable[P, T], *args: P.args, **kwargs: P.kwargs) -> T:
    return fn(*args, **kwargs)

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Tomperez98
Comment options

@Tomperez98
Comment options

Answer selected by Tomperez98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants