From 95a5b726956976dc7d116a126939f556e73a064d Mon Sep 17 00:00:00 2001 From: Florian Ludwig Date: Sun, 16 Jun 2019 11:54:14 +0200 Subject: [PATCH] change http.cookies.Morsel to Dict[str, Any] 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 5e5d58a00583..1e1091ba1c4a 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