Support parameter auto casting int/float

This commit is contained in:
allegroai
2019-06-15 00:30:32 +03:00
parent e0d8c2fa91
commit ac9aba9242
2 changed files with 4 additions and 2 deletions

View File

@@ -268,7 +268,8 @@ class _Arguments(object):
v_type = type(v)
# assume more general purpose type int -> float
if v_type == int:
v_type = float
if int(v) != float(v):
v_type = float
elif v_type == bool:
# cast based on string or int
try: