pydata/pandas — pull request #8916 by shoyer (2014-11-28 05:37:15+00:00)
Title: BUG/ENH: cleanup for Timestamp arithmetic

Fixes #8865 (Timestamp - Timestamp -> Timedelta)

This PR cleans up and extends `Timestamp` arithmetic similarly to my treatment for `Timedelta` in #8884.

It includes a new `to_datetime64()` method, and arithmetic now works between Timestamp and ndarrays. I also ensure comparison operations work properly between all of (Timestamp, Timedelta, NaT) and ndarrays.

Implementation notes: wide use of the `NotImplemented` singleton let me cleanup some complex logic. I also strove to reduce the tight-coupling of `Timestamp`/`Timedelta` to pandas itself by removing use of the `_typ` property in tslib (I honestly don't quite understand why it needs to exist) and by not treating series/index any differently from any other ndarray-like object.

CC @jreback @jorisvandenbossche @immerrr