Skip to content

Commit

Permalink
change http.cookies.Morsel to Dict[str, Any] (#3060)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
FlorianLudwig authored and JelleZijlstra committed Jun 19, 2019
1 parent d149fe4 commit 2e10326
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stdlib/3/http/cookies.pyi
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 2e10326

Please sign in to comment.