1
1
# -*- coding: utf-8 -*-
2
- # NOTE: Every type ignore in this module is necessary due to
3
- # false-positive bugs in mypy. Feel free to remove them as they'll be
4
- # fixed. See GitHub issues for more info:
5
- # `https://github.com/python/mypy/issues/1105`,
6
- # `https://github.com/python/mypy/issues/1106`,
7
- # `https://github.com/python/mypy/issues/1107`.
8
2
9
3
10
4
try :
11
5
from enum import Enum , EnumMeta
12
6
except ImportError :
13
7
# We are on Python 2.7 and enum34 package is not installed.
14
- class Enum (object ): # type: ignore
8
+ class Enum (object ):
15
9
pass
16
10
17
- class EnumMeta (object ): # type: ignore
11
+ class EnumMeta (object ):
18
12
pass
19
13
20
14
@@ -23,34 +17,34 @@ class EnumMeta(object): # type: ignore
23
17
from pydantic .main import ModelMetaclass as PydanticSpec
24
18
except ImportError :
25
19
# Pydantic package is not installed.
26
- class PydanticSpec (object ): # type: ignore
20
+ class PydanticSpec (object ):
27
21
pass
28
22
29
- class PydanticError (object ): # type: ignore
23
+ class PydanticError (object ):
30
24
pass
31
25
32
26
33
27
try :
34
28
from marshmallow .schema import SchemaMeta as MarshmallowSpec
35
29
except ImportError :
36
30
# Marshmallow package is not installed.
37
- class MarshmallowSpec (object ): # type: ignore
31
+ class MarshmallowSpec (object ):
38
32
pass
39
33
40
34
41
35
try :
42
36
from cerberus import Validator as CerberusSpec
43
37
except ImportError :
44
38
# Cerberus package is not installed.
45
- class CerberusSpec (object ): # type: ignore
39
+ class CerberusSpec (object ):
46
40
pass
47
41
48
42
49
43
try :
50
44
from textwrap import indent
51
45
except ImportError :
52
46
# We are on Python 2.7
53
- def indent (text , prefix ): # type: ignore
47
+ def indent (text , prefix ):
54
48
return "" .join (map (lambda l : prefix + l , text .splitlines (True )))
55
49
56
50
0 commit comments