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

Use NotImplemented in defined classes. #245

Merged
merged 3 commits into from Apr 7, 2016

Conversation

pganssle
Copy link
Member

@pganssle pganssle commented Apr 6, 2016

The Python documentation indicates that NotImplemented should be returned for rich comparison and arithmetic operations on defined classes. Up until now, we've been raising TypeError or returning False automatically, which prevents less picky classes from properly implementing operations with respect to our classes.

I think this covers all the operators we define.

@pganssle pganssle added this to the 2.6.0 milestone Apr 6, 2016
@pganssle pganssle merged commit d6a830b into dateutil:master Apr 7, 2016
@pganssle pganssle mentioned this pull request Nov 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant