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

Fix #316: Return NotImplemented for comparisons #318

Merged
merged 1 commit into from Nov 8, 2020

Conversation

tomschr
Copy link
Member

@tomschr tomschr commented Nov 8, 2020

The former code raised a TypeError exception for comparisons like __gt__, __lt__ etc. to indicate a wrong type.

However, according to NotImplemented documentation, we should return(!) NotImplemented (not raise) when a comparison with an invalid type is not implemented.

The former code raised a TypeError exception for comparisons
like __gt__, __lt__ etc. to indicate a wrong type.

However, according to NotImplemented[1] documentation,
we should return(!) NotImplemented (not raise) when a
comparison with an invalid type is not implemented.

[1] https://docs.python.org/3/library/constants.html#NotImplemented
@tomschr tomschr added the Bug Error, flaw or fault to produce incorrect or unexpected results label Nov 8, 2020
@tomschr tomschr self-assigned this Nov 8, 2020
@tomschr tomschr added this to In progress in Release 3 via automation Nov 8, 2020
@tomschr tomschr merged commit c75737d into python-semver:master Nov 8, 2020
Release 3 automation moved this from In progress to Done Nov 8, 2020
@tomschr tomschr deleted the bugfix/316-notimplemented branch November 8, 2020 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Error, flaw or fault to produce incorrect or unexpected results
Projects
No open projects
Release 3
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

1 participant