Skip to content
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

Incorrect type hint for api_settings.DEFAULT_FILTER_BACKENDS #225

Open
nils-van-zuijlen opened this issue Jun 1, 2022 · 0 comments
Open
Labels
bug Something isn't working

Comments

@nils-van-zuijlen
Copy link
Contributor

Bug report

What's wrong

In api_settings, DEFAULT_FILTER_BACKENDS is typed as Sequence[str], but it is used in GenericAPIView, which is typed as Sequence[Union[Type[BaseFilterBackend], Type[BaseFilterProtocol[_MT_co]]]].

How is that should be

As stated in the APISettings docstring](https://github.com/encode/django-rest-framework/blob/e5fb9af0eaffde683fa0af3987085f86cf0d2640/rest_framework/settings.py#L184), the import strings are resolved to the corresponding classes, so the resulting strings should not appear in api_settings.

System information

  • OS:
  • python version: 3.10.4
  • django version: 4.0.4
  • mypy version: 0.950
  • django-stubs version: 1.11.0
@nils-van-zuijlen nils-van-zuijlen added the bug Something isn't working label Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

1 participant