From: Adrian Garcia Badaracco <1755071+adriangb@users.noreply.github.com> Date: Tue, 28 Jun 2022 05:32:41 +0000 (-0700) Subject: fix type annotations in responses.py (#1711) X-Git-Tag: 0.20.4~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c4e583b85d5835117d07bb3f5ee26eee74cf736b;p=thirdparty%2Fstarlette.git fix type annotations in responses.py (#1711) --- 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: