Skip to content

Commit c69bc81

Browse files
authored
Update _MorselDictType for version compatibility
Refactor _MorselDictType to conditionally include 'partitioned' field for Python 3.14 and above.
1 parent d8238fe commit c69bc81

1 file changed

Lines changed: 26 additions & 13 deletions

File tree

stdlib/http/cookies.pyi

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,32 @@ def _unquote(str: str) -> str: ...
2020

2121
class CookieError(Exception): ...
2222

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
23+
if sys.version_info >= (3, 14):
24+
@type_check_only
25+
class _MorselDictType(TypedDict):
26+
expires: Any
27+
path: Any
28+
comment: Any
29+
domain: Any
30+
max_age: Any
31+
secure: Any
32+
httponly: Any
33+
version: Any
34+
samesite: Any
35+
partitioned: Any # New in version 3.14.
36+
else:
37+
@type_check_only
38+
class _MorselDictType(TypedDict):
39+
expires: Any
40+
path: Any
41+
comment: Any
42+
domain: Any
43+
max_age: Any
44+
secure: Any
45+
httponly: Any
46+
version: Any
47+
samesite: Any
48+
3649

3750
class Morsel(_MorselDictType, Generic[_T]):
3851
@property

0 commit comments

Comments
 (0)