summaryrefslogtreecommitdiff
path: root/jsonschema/_validators.py
diff options
context:
space:
mode:
authorJulian Berman <Julian@GrayVines.com>2020-10-20 09:53:34 -0400
committerJulian Berman <Julian@GrayVines.com>2020-10-20 11:38:18 -0400
commit7265a93de17e59173c72255b9d2a3057e3067794 (patch)
tree2503da096e02cd6c0bf7cd35915b96a361f8369a /jsonschema/_validators.py
parent7be95e66f5a0679eeea16da0bd9e8a3d3f1fe7af (diff)
downloadjsonschema-7265a93de17e59173c72255b9d2a3057e3067794.tar.gz
Vanilla flake8.
Diffstat (limited to 'jsonschema/_validators.py')
-rw-r--r--jsonschema/_validators.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/jsonschema/_validators.py b/jsonschema/_validators.py
index 7e8c95a..0f7b6fb 100644
--- a/jsonschema/_validators.py
+++ b/jsonschema/_validators.py
@@ -170,14 +170,16 @@ def multipleOf(validator, dB, instance, schema):
try:
failed = int(quotient) != quotient
except OverflowError:
- # When `instance` is large and `dB` is less than one, quotient can
- # overflow to infinity; and then casting to int raises an error.
+ # When `instance` is large and `dB` is less than one,
+ # quotient can overflow to infinity; and then casting to int
+ # raises an error.
#
- # In this case we fall back to Fraction logic, which is exact and
- # cannot overflow. The performance is also acceptable: we try the
- # fast all-float option first, and we know that fraction(dB) can have
- # at most a few hundred digits in each part. The worst-case slowdown
- # is therefore for already-slow enormous integers or Decimals.
+ # In this case we fall back to Fraction logic, which is
+ # exact and cannot overflow. The performance is also
+ # acceptable: we try the fast all-float option first, and
+ # we know that fraction(dB) can have at most a few hundred
+ # digits in each part. The worst-case slowdown is therefore
+ # for already-slow enormous integers or Decimals.
failed = (Fraction(instance) / Fraction(dB)).denominator != 1
else:
failed = instance % dB