Skip to content

Commit 2f372de

Browse files
committed
Merge branch 'fixing-bug-when-string-starts-or-ends-with-e' of https://github.com/HubertPalo/jsonargparse into fixing-bug-when-string-starts-or-ends-with-e
2 parents ca652d0 + dd677d2 commit 2f372de

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

jsonargparse/_loaders_dumpers.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ def load_basic(value):
3030
return None
3131
if value.isdigit() or (value.startswith("-") and value[1:].isdigit()):
3232
return int(value)
33-
if not value.startswith('e') and not value.endswith('e') and value.replace(".", "", 1).replace("e", "", 1).replace("-", "", 2).isdigit() and ("e" in value or "." in value):
33+
if (
34+
not value.startswith("e")
35+
and not value.endswith("e")
36+
and value.replace(".", "", 1).replace("e", "", 1).replace("-", "", 2).isdigit()
37+
and ("e" in value or "." in value)
38+
):
3439
return float(value)
3540
return not_loaded
3641

0 commit comments

Comments
 (0)