From c4e583b85d5835117d07bb3f5ee26eee74cf736b Mon Sep 17 00:00:00 2001 From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Mon, 27 Jun 2022 22:32:41 -0700 Subject: [PATCH] fix type annotations in responses.py (#1711) --- starlette/responses.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/starlette/responses.py b/starlette/responses.py index d6a9462b..a4ca8caa 100644 --- a/starlette/responses.py +++ b/starlette/responses.py @@ -112,7 +112,7 @@ class Response: httponly: bool = False, samesite: typing.Optional[Literal["lax", "strict", "none"]] = "lax", ) -> None: - cookie: http.cookies.BaseCookie = http.cookies.SimpleCookie() + cookie: "http.cookies.BaseCookie[str]" = http.cookies.SimpleCookie() cookie[key] = value if max_age is not None: cookie[key]["max-age"] = max_age @@ -185,7 +185,7 @@ class JSONResponse(Response): self, content: typing.Any, status_code: int = 200, - headers: typing.Optional[dict] = None, + headers: typing.Optional[typing.Dict[str, str]] = None, media_type: typing.Optional[str] = None, background: typing.Optional[BackgroundTask] = None, ) -> None: