-
In the following code, How should I write the type annotations for
|
Beta Was this translation helpful? Give feedback.
Answered by
erictraut
Apr 14, 2023
Replies: 1 comment
-
I don't see a way to do this if you want to preserve the ability to use the first parameter as a keyword parameter. If you're willing to assume that the first parameter is always used as a positional-only parameter, then you can use def add_logging_with_first_arg(
f: Callable[Concatenate[str, P], T]
) -> Callable[Concatenate[str, P], T]: ... |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
lexdene
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I don't see a way to do this if you want to preserve the ability to use the first parameter as a keyword parameter. If you're willing to assume that the first parameter is always used as a positional-only parameter, then you can use
Concatenate
.