-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_route does not allow **kwargs #2038
Comments
|
I realized I did not provide a clearer example. Here's how to repro:
This seems to raise a error: How can I pass such options into a handler ? |
I don't think it's good idea. |
I see what you are saying. but wouldn't it be a cleaner api for developers if they did not have to use functools and if the library behaved like other web frameworks ? |
Did you mean you think the suggestion is a bad idea ? |
You shouldn't need to pass extra arguments to view functions. You should use |
Mixing parameters for router (like |
I see you point guys. Adding it to the app as @samuelcolvin suggested is a satisfactory approach. Thanks everyone. |
@samuelcolvin you caught @coolnay309 mind better than me. |
Long story short
add_route does not allow **kwargs, it should. Open to suggestions here.
Expected behaviour
add_get supports it but not add_route. add_route should ideally support it.
Actual behaviour
Steps to reproduce
pass **kwargs to add_get will give this exception: TypeError: add_route() got an unexpected keyword argument
The text was updated successfully, but these errors were encountered: