fix type annotations in responses.py (#1711)

This commit is contained in:
Adrian Garcia Badaracco 2022-06-27 22:32:41 -07:00 committed by GitHub
parent 795cf608f6
commit c4e583b85d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View 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: