@@ -2,10 +2,10 @@ import builtins
2
2
import sys
3
3
import types
4
4
from _typeshed import ReadableBuffer , SupportsRead , SupportsWrite
5
- from typing import Any
5
+ from typing import Any , Final
6
6
from typing_extensions import TypeAlias
7
7
8
- version : int
8
+ version : Final [ int ]
9
9
10
10
_Marshallable : TypeAlias = (
11
11
# handled in w_object() in marshal.c
@@ -28,14 +28,22 @@ _Marshallable: TypeAlias = (
28
28
| ReadableBuffer
29
29
)
30
30
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 ):
32
36
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 : ...
34
37
def dumps (value : _Marshallable , version : int = 4 , / , * , allow_code : bool = True ) -> bytes : ...
35
- def loads (bytes : ReadableBuffer , / , * , allow_code : bool = True ) -> Any : ...
36
38
37
39
else :
38
40
def dump (value : _Marshallable , file : SupportsWrite [bytes ], version : int = 4 , / ) -> None : ...
39
- def load (file : SupportsRead [bytes ], / ) -> Any : ...
40
41
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 : ...
41
49
def loads (bytes : ReadableBuffer , / ) -> Any : ...
0 commit comments