From 644052148aec0114daf3d75a18f9bab48057ff17 Mon Sep 17 00:00:00 2001 From: w0rp Date: Thu, 23 Jun 2022 11:52:31 +0100 Subject: [PATCH] Set generic type of SimpleCookie (#1018) Pyright complains about `response.cookies` because the generic type isn't known. `str` may or may not be the correct type to use here. Something should be set here. --- django-stubs/template/response.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/django-stubs/template/response.pyi b/django-stubs/template/response.pyi index d776a86..18306f5 100644 --- a/django-stubs/template/response.pyi +++ b/django-stubs/template/response.pyi @@ -17,7 +17,7 @@ class ContentNotRenderedError(Exception): ... class SimpleTemplateResponse(HttpResponse): content: Any = ... closed: bool - cookies: SimpleCookie + cookies: SimpleCookie[str] status_code: int rendering_attrs: Any = ... template_name: _TemplateForResponseT = ... @@ -48,7 +48,7 @@ class TemplateResponse(SimpleTemplateResponse): closed: bool context: RequestContext context_data: Optional[Dict[str, Any]] - cookies: SimpleCookie + cookies: SimpleCookie[str] csrf_cookie_set: bool json: functools.partial redirect_chain: List[Tuple[str, int]]