From: Yuemao Xu (yuemxu) Date: Mon, 17 Jun 2024 10:27:20 +0000 (+0200) Subject: web: More accurate typing for get_cookie X-Git-Tag: v6.5.0b1~44^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c3f75e9d837991afe569fbf11c206df63a3ee22;p=thirdparty%2Ftornado.git web: More accurate typing for get_cookie --- diff --git a/tornado/web.py b/tornado/web.py index 30cef30b..1d823347 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -617,6 +617,14 @@ class RequestHandler(object): `self.request.cookies <.httputil.HTTPServerRequest.cookies>`.""" return self.request.cookies + @overload + def get_cookie(self, name: str, default: str) -> str: + pass + + @overload + def get_cookie(self, name: str, default: None = None) -> Optional[str]: + pass + def get_cookie(self, name: str, default: Optional[str] = None) -> Optional[str]: """Returns the value of the request cookie with the given name.