alecthomas / voluptuous

CONTRIBUTIONS ONLY: Voluptuous, despite the name, is a Python data validation library.
https://pypi.org/project/voluptuous
BSD 3-Clause "New" or "Revised" License
1.82k stars 218 forks source link

Handle incomparable values in Range #414

Closed monopolis closed 4 years ago

monopolis commented 4 years ago

In Python3, some values that are comparable in Python2, are no longer comparable. One instance of this is None, which in Python2 is always less than any other object. In Python3, however, a TypeError is raised if it is used in a comparison.

This commit series adds unit tests for this in the Range validator, and follows it up with adding a fix for the error.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-1.0%) to 94.324% when pulling f90e6a82f6068531ed2caae0a35b8c02d9e0653b on monopolis:incomparable-values-in-range into f5e64dd7e26fb2de0ca4baec42c426c60cb061c2 on alecthomas:master.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.6%) to 94.655% when pulling f90e6a82f6068531ed2caae0a35b8c02d9e0653b on monopolis:incomparable-values-in-range into f5e64dd7e26fb2de0ca4baec42c426c60cb061c2 on alecthomas:master.

alecthomas commented 4 years ago

Seems reasonable.