Closed eltoder closed 9 months ago
@lballabio If you think it's worth it, we can put back Money.compare
as a deprecated alias to compareTo
using %proxycode and @Deprecated
.
Just compareTo
is ok, I guess. Do these classes need to implement Comparable
?
Added Comparable<T>
implementations.
Fix comparing Money in Python:
__eq__
and__ne__
were missing.Expose
__cmp__
as compareTo() in Java. This is the correct name for this method. "compare" is for Comparators[1][2]. Note that this is only a change for Money. Period and Date did not have__cmp__
exposed in Java until #610.Remove
__cmp__
and__nonzero__
methods from Python. These were Python 2 magic methods that are not used in Python 3[3].[1] https://docs.oracle.com/javase/8/docs/api/java/lang/Comparable.html#compareTo-T- [2] https://docs.oracle.com/javase/8/docs/api/java/util/Comparator.html#compare-T-T- [3] https://docs.python.org/3/reference/datamodel.html