Closed schunka closed 8 years ago
Most likely caused by 30c95243ac04bb981de9a2cf8db2b63a6edd9b17, which replaced tp_compare with tp_richcompare
The original tp_compare was not implemented well. It assumes both arguments are DateTime objects, which is not true for the mentioned case, and probably lead to undefined behavior silently.
A python way would be to return False when comparing different types for equality, and raise TypeError for other operations.
Whenever you try to compare DateTime object to some other type it throws: TypeError: arg #2 is not a DateTime, it is ...
Reproducible in versions 5.1.0 and higher This is really unexpected behavior and from my point of view a bug. In version 5.0.9 and lower comparison behaves expectedly, like any other data type in python. If this is desired behavior, it should be documented and pinpointed for its "non pythonian way" characteristic.