Skip to content

Commit

Permalink
Modify scientific notation detection
Browse files Browse the repository at this point in the history
  • Loading branch information
thombashi committed Jan 5, 2020
1 parent 62cd680 commit b8b3f98
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion test/checker/test_checker_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Test_Integer_is_type(object):
[text_type(MAXSIZE), StrictLevel.MIN + 1, True],
[text_type(MAXSIZE), StrictLevel.MAX, False],
["45e76582", StrictLevel.MIN, True],
["45e76582", StrictLevel.MIN + 1, True],
["45e76582", StrictLevel.MIN + 1, False],
["45e76582", StrictLevel.MAX, False],
["4.5e-4", StrictLevel.MIN, True],
["4.5e-4", StrictLevel.MIN + 1, False],
Expand Down
2 changes: 1 addition & 1 deletion test/checker/test_checker_realnumber.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class Test_RealNumber_is_type(object):
)
+ list(
itertools.product(
[0, 0.0, 0.0, six.MAXSIZE, -six.MAXSIZE], [StrictLevel.MIN + 1], [False]
[0, 0.0, 0.0, six.MAXSIZE, -six.MAXSIZE, "4.5e444"], [StrictLevel.MIN + 1], [False]
)
)
+ list(itertools.product(["1.1", "4.5e-4"], [StrictLevel.MIN + 1], [True]))
Expand Down
2 changes: 1 addition & 1 deletion typepy/checker/_integer.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from ._common import isinf, isnan


RE_SCIENTIFIC_NOTATION = re.compile(r"^-?\d+(?:\.\d*)?[eE][+\-]?\d{,2}$")
RE_SCIENTIFIC_NOTATION = re.compile(r"^-?\d+(?:\.\d*)?[eE][+\-]?\d{3,}$")


class IntegerTypeCheckerStrictLevel0(TypeCheckerBase):
Expand Down

0 comments on commit b8b3f98

Please sign in to comment.