dh-tech / undate-python

A Python library for working with fuzzy, partial, or otherwise uncertain dates
Apache License 2.0
8 stars 1 forks source link

implement comparison methods #5

Closed rlskoeser closed 7 months ago

rlskoeser commented 2 years ago

implement greater than / less than rich comparison methods for both objects

For reference python documentation: https://docs.python.org/3.9/reference/datamodel.html#object.__lt__

We need to decide what to return in cases where gt/lt can't be determined — maybe a defined constant in undate.undate ? Documentation says we can return

NotImplemented in the case of a false comparison ... but it's not clear to me if that would make sense in this case or not.

test cases should include individual dates and date ranges, dates that can be compared and that can't; would also be nice to see how sorting works (or doesn't)

rlskoeser commented 7 months ago

comparison methods implemented in #65