Typing improvements in Middleware. #2380
Replies: 1 comment 1 reply
-
Please submit a PR and we can look at it 😄 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi everyone!
Using
Middleware
oradd_middleware
hides the signature of the Middleware class being passed.For example, the following code:
raises a Runtime exception:
but no typing errors.
This can be improved by leveraging
ParamSpec
introduced in Python 3.10.Here's a reference implementation in my fork: pawelrubin@0f4c8c5
I'd love to hear the Maintainers' and Community's feedback regarding this issue.
Beta Was this translation helpful? Give feedback.
All reactions