@@ -2,10 +2,10 @@ import builtins
22import sys
33import types
44from _typeshed import ReadableBuffer , SupportsRead , SupportsWrite
5- from typing import Any
5+ from typing import Any , Final
66from typing_extensions import TypeAlias
77
8- version : int
8+ version : Final [ int ]
99
1010_Marshallable : TypeAlias = (
1111 # handled in w_object() in marshal.c
@@ -28,14 +28,22 @@ _Marshallable: TypeAlias = (
2828 | ReadableBuffer
2929)
3030
31- if sys .version_info >= (3 , 13 ):
31+ if sys .version_info >= (3 , 14 ):
32+ def dump (value : _Marshallable , file : SupportsWrite [bytes ], version : int = 5 , / , * , allow_code : bool = True ) -> None : ...
33+ def dumps (value : _Marshallable , version : int = 5 , / , * , allow_code : bool = True ) -> bytes : ...
34+
35+ elif sys .version_info >= (3 , 13 ):
3236 def dump (value : _Marshallable , file : SupportsWrite [bytes ], version : int = 4 , / , * , allow_code : bool = True ) -> None : ...
33- def load (file : SupportsRead [bytes ], / , * , allow_code : bool = True ) -> Any : ...
3437 def dumps (value : _Marshallable , version : int = 4 , / , * , allow_code : bool = True ) -> bytes : ...
35- def loads (bytes : ReadableBuffer , / , * , allow_code : bool = True ) -> Any : ...
3638
3739else :
3840 def dump (value : _Marshallable , file : SupportsWrite [bytes ], version : int = 4 , / ) -> None : ...
39- def load (file : SupportsRead [bytes ], / ) -> Any : ...
4041 def dumps (value : _Marshallable , version : int = 4 , / ) -> bytes : ...
42+
43+ if sys .version_info >= (3 , 13 ):
44+ def load (file : SupportsRead [bytes ], / , * , allow_code : bool = True ) -> Any : ...
45+ def loads (bytes : ReadableBuffer , / , * , allow_code : bool = True ) -> Any : ...
46+
47+ else :
48+ def load (file : SupportsRead [bytes ], / ) -> Any : ...
4149 def loads (bytes : ReadableBuffer , / ) -> Any : ...
0 commit comments