]> git.ipfire.org Git - thirdparty/starlette.git/commitdiff
fix type annotations in responses.py (#1711)
authorAdrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com>
Tue, 28 Jun 2022 05:32:41 +0000 (22:32 -0700)
committerGitHub <noreply@github.com>
Tue, 28 Jun 2022 05:32:41 +0000 (22:32 -0700)
starlette/responses.py

index d6a9462b8cff4ee1219a04fbff111c7cd77f978a..a4ca8caa4e2af183ae851b8ecc4b019034308d78 100644 (file)
@@ -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: