Hacker News new | past | comments | ask | show | jobs | submit login

Hm, I don't know, I guess == on datetimes means "is the same instant" to me.



That's what it means to you

But an API should never get into a place where your personal choices should matter and various incompatible interpretations potentially make sense to different people.


Noone else has to guess (or go and inspect what an overloaded comparison operator actually does) if there is a meaningful name attached to the comparison, like in the parent comment.


Sure, but there's also a reason we don't have `x.is_numerically_equal_to(3)`.


And that reason is that there is a canonical definition of what it means for two numbers to be equal.

The fact that your intuition of "these two timestamps are equal" is "these two timestamps denotes the same instant" seems problematic when we know that the notions of timestamps and time are not in fact aligned (because, for example, of leap seconds).




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: