Commit c4e6f5a 1 parent afa3f6f commit c4e6f5a Copy full SHA for c4e6f5a
File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 6
6
7
7
# import custom Yaml types to handle sequences
8
8
from ruamel .yaml import CommentedSeq , CommentedMap
9
+ from ruamel .yaml .scalarfloat import ScalarFloat
10
+ from ruamel .yaml .scalarint import ScalarInt
11
+ from ruamel .yaml .scalarbool import ScalarBoolean
9
12
10
13
11
14
def infer_boolean (var , strict : bool = True ):
@@ -117,9 +120,9 @@ def __call__(self, var):
117
120
var: original variable (any type)
118
121
119
122
"""
120
- if self .orig_type == bool :
123
+ if self .orig_type == bool or self . orig_type == ScalarBoolean :
121
124
return infer_boolean (var , self .strict )
122
- elif self .orig_type == float or self .orig_type == int :
125
+ elif self .orig_type == float or self .orig_type == int or self . orig_type == ScalarFloat or self . orig_type == ScalarInt :
123
126
return infer_numeric (var , self .strict )
124
127
elif self .orig_type == tuple or self .orig_type == list or self .orig_type == CommentedMap or self .orig_type == CommentedSeq :
125
128
return infer_iterable (var , None , self .strict )
You can’t perform that action at this time.
0 commit comments