Skip to content

Commit b306d77

Browse files
authored
1 parent e80d84d commit b306d77

1 file changed

Lines changed: 18 additions & 2 deletions

File tree

stdlib/http/cookies.pyi

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import sys
12
from collections.abc import Iterable, Mapping
23
from types import GenericAlias
3-
from typing import Any, Generic, TypeVar, overload
4+
from typing import Any, Generic, TypedDict, TypeVar, overload, type_check_only
45
from typing_extensions import TypeAlias
56

67
__all__ = ["CookieError", "BaseCookie", "SimpleCookie"]
@@ -19,7 +20,22 @@ def _unquote(str: str) -> str: ...
1920

2021
class CookieError(Exception): ...
2122

22-
class Morsel(dict[str, Any], Generic[_T]):
23+
@type_check_only
24+
class _MorselDictType(TypedDict):
25+
expires: Any
26+
path: Any
27+
comment: Any
28+
domain: Any
29+
max_age: Any
30+
secure: Any
31+
httponly: Any
32+
version: Any
33+
samesite: Any
34+
if sys.version_info >= (3, 14):
35+
partitioned: Any
36+
37+
38+
class Morsel(_MorselDictType, Generic[_T]):
2339
@property
2440
def value(self) -> str: ...
2541
@property

0 commit comments

Comments
 (0)