@@ -5,8 +5,15 @@ from typing import (
5
5
Type , TypeVar ,
6
6
)
7
7
from typing import Dict as DictT
8
- from enum import Enum
9
8
import sys
9
+ if sys .version_info >= (3 ,):
10
+ from enum import Enum
11
+
12
+ class PlistFormat (Enum ):
13
+ FMT_XML = ... # type: PlistFormat
14
+ FMT_BINARY = ... # type: PlistFormat
15
+ FMT_XML = PlistFormat .FMT_XML
16
+ FMT_BINARY = PlistFormat .FMT_BINARY
10
17
11
18
mm = MutableMapping [str , Any ]
12
19
_D = TypeVar ('_D' , bound = mm )
@@ -15,15 +22,9 @@ if sys.version_info >= (3,):
15
22
else :
16
23
_Path = Union [str , unicode ]
17
24
18
-
19
- if sys .version_info >= (3 ,):
20
- class PlistFormat (Enum ):
21
- FMT_XML = ... # type: PlistFormat
22
- FMT_BINARY = ... # type: PlistFormat
23
-
24
25
if sys .version_info >= (3 , 4 ):
25
26
def load (fp : IO [bytes ], * , fmt : Optional [PlistFormat ] = ...,
26
- use_builtin_types : bool , dict_type : Type [_D ] = ...) -> _D : ...
27
+ use_builtin_types : bool , dict_type : Type [_D ] = ...) -> _D : ...
27
28
def loads (data : bytes , * , fmt : Optional [PlistFormat ] = ...,
28
29
use_builtin_types : bool = ..., dict_type : Type [_D ] = ...) -> _D : ...
29
30
def dump (value : Mapping [str , Any ], fp : IO [bytes ], * ,
@@ -54,7 +55,3 @@ if sys.version_info >= (3,):
54
55
class Data :
55
56
data = ... # type: bytes
56
57
def __init__ (self , data : bytes ) -> None : ...
57
-
58
- if sys .version_info >= (3 ,):
59
- FMT_XML = PlistFormat .FMT_XML
60
- FMT_BINARY = PlistFormat .FMT_BINARY
0 commit comments