carltongibson / django-filter

A generic system for filtering Django QuerySets based on user selections

Home Page:https://django-filter.readthedocs.io/en/main/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix base class for correct typing support

last-partizan opened this issue · comments

Hi, we're using pyright to type-check our code, and djangorestframework-types as types for DRF.

Type for filter_backends is defined as

    filter_backends: Sequence[Type[BaseFilterBackend]]

So, all filter must be subclasses of BaseFilterBackend.

Could you please add it as base class to DjangoFilterBackend?

It might be that we can define a Protocol here, but adding a inheritance just to satisfy the type checker is not the right move.

yeah, we can definitely add protocol. Thanks.