Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle incomparable values in Range #414

Merged
merged 2 commits into from
Nov 28, 2019

Conversation

monopolis
Copy link
Contributor

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.

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 handles said TypeError and issues a RangeInvalid exception
instead.
@coveralls
Copy link

Coverage Status

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

@coveralls
Copy link

Coverage Status

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

@alecthomas
Copy link
Owner

Seems reasonable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants