From a259b04d9cf9b3d8ddd4fe3f96a16cd75a5d6a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20P=C3=A9pin?= Date: Fri, 3 Jan 2020 17:29:55 +0100 Subject: [PATCH] Explicative comment about the Type[M] annotation --- shared/views/autocomplete.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/shared/views/autocomplete.py b/shared/views/autocomplete.py index e8d90590..708fe554 100644 --- a/shared/views/autocomplete.py +++ b/shared/views/autocomplete.py @@ -28,6 +28,8 @@ class ModelSearch(Generic[M]): >>> user_search.search(["toto", "foo"]) # returns a queryset of Users """ + # This says that `model` is the class corresponding to the type variable M (or a + # subclass). model: Type[M] search_fields: Iterable[str]