Closed
Description
If we treat NaT as a datetime, we would expect pd.NaT == "foo" to return False, != to return True, and for the inequalities to raise:
>>> np.datetime64("NaT", "ns") < "foo"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'numpy.ndarray' and 'str'
>>> np.nan < "foo"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'float' and 'str'
>>> pd.NaT < "foo"
False
It isn't obvious to me that the existing behavior is intentional. If we change this to raise, we can simplify NaT.__richcmp__
a bit.