-
-
Notifications
You must be signed in to change notification settings - Fork 117
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
Python 3.11, support new http.HTTPMethod enum in action and view #396
Comments
I'm unsure about this. While As far as I can tell, there are no unit tests in DRF that use I would be comfortable with allowing this when we have some commitment from DRF upstream that this will be supported going forward, preferably in the form of tests or documentation examples. So maybe open an issue with DRF upstream and see what they think. |
Thank you @intgr , going to create the ticket on DRF itself, if they will be willing to support this standard library enums |
Hello @intgr , the parent issue has been fixed and merged? Can we do something here also to go forward? |
Yes, are you interested in creating a pull request? |
I can try to do it @intgr , will do it in close future. Thanks 👍 |
Bug report
When using python 3.11, instead of hardcoding HTTP verbs, now we can use official enum:
HTTPMethod
as well asHTTPStatus
for statusesWhat's wrong
We would like to use it in
decorators.action(methods=[HTTPMethod.POST])
for instance.Currently it does not work and produce the following error:
How is that should be
No
mypy
error should be reportedSystem information
python
version: 3.11django
version: 3.2.18mypy
version: 1.2.0django-stubs
version: 1.16.0djangorestframework-stubs
version: 1.10.0The text was updated successfully, but these errors were encountered: