1 # Stubs for http.cookies (Python 3.5)
\r
3 from typing import Generic, Dict, List, Mapping, MutableMapping, Optional, TypeVar, Union
\r
5 _DataType = Union[str, Mapping[str, Union[str, 'Morsel']]]
\r
8 class CookieError(Exception): ...
\r
10 class Morsel(Dict[str, str], Generic[_T]):
\r
11 value = ... # type: str
\r
12 coded_value = ... # type: _T
\r
13 key = ... # type: str
\r
14 def set(self, key: str, val: str, coded_val: _T) -> None: ...
\r
15 def isReservedKey(self, K: str) -> bool: ...
\r
16 def output(self, attrs: Optional[List[str]] = ...,
\r
17 header: str = ...) -> str: ...
\r
18 def js_output(self, attrs: Optional[List[str]] = ...) -> str: ...
\r
19 def OutputString(self, attrs: Optional[List[str]] = ...) -> str: ...
\r
21 class BaseCookie(Dict[str, Morsel], Generic[_T]):
\r
22 def __init__(self, input: Optional[_DataType] = ...) -> None: ...
\r
23 def value_decode(self, val: str) -> _T: ...
\r
24 def value_encode(self, val: _T) -> str: ...
\r
25 def output(self, attrs: Optional[List[str]] = ..., header: str = ...,
\r
26 sep: str = ...) -> str: ...
\r
27 def js_output(self, attrs: Optional[List[str]] = ...) -> str: ...
\r
28 def load(self, rawdata: _DataType) -> None: ...
\r
29 def __setitem__(self, key: str, value: Union[str, Morsel]) -> None: ...
\r
31 class SimpleCookie(BaseCookie): ...
\r