mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
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
This commit is contained in:
committed by
Jelle Zijlstra
parent
d149fe435c
commit
2e10326b50
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user