-
Notifications
You must be signed in to change notification settings - Fork 218
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
Adding new ThreeWayComparable interface #457
Adding new ThreeWayComparable interface #457
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this contribution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few more minor comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Many thanks again!
Re: #356
This adds a new
TotallyOrdered
interface, similar toComparable
which returns an integer representing the <, ==, > relation between values. TheCompareDepth
function has been to updated check for this interface and handle this return style if applicable.Also refactors
int
,float
,time.Time
andtime.Duration
types to use the new interface.The previous
Comparable
interface will have to be maintained, not just for API compatibility but also for types which define equality/inequality but not ordering (for example, structs)Open questions:
TotallyOrdered