From 2e10326b5064621a2ac33b9b3afe280cf26fc46d Mon Sep 17 00:00:00 2001 From: Florian Ludwig Date: Thu, 20 Jun 2019 00:17:16 +0200 Subject: [PATCH] change http.cookies.Morsel to Dict[str, Any] (#3060) Morsel does cast any value to string and therfor any is the correct typehint. For some keys other types then strings are more appropiate anyway, max-age can take an integer (unix time) and http-only a boolean. Closes #3059 --- stdlib/3/http/cookies.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/3/http/cookies.pyi b/stdlib/3/http/cookies.pyi index 5e5d58a00..1e1091ba1 100644 --- a/stdlib/3/http/cookies.pyi +++ b/stdlib/3/http/cookies.pyi @@ -1,13 +1,13 @@ # Stubs for http.cookies (Python 3.5) -from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union +from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union, Any _DataType = Union[str, Mapping[str, Union[str, Morsel]]] _T = TypeVar('_T') class CookieError(Exception): ... -class Morsel(Dict[str, str], Generic[_T]): +class Morsel(Dict[str, Any], Generic[_T]): value: str coded_value: _T key: str