[REF] Move comparison methods to EAMixins, share code
State: closed

Changes an old usage numpy's C API that is deprecated.  This won't get rid of the warnings because cython hasn't changed it, but still.

Also stops making copies of offsets since they are now immutable.

Handles a handful of changes requested in the last pass: de-privatizes _quarter_to_myear (plus bonus docstring), renames _generate --> _generate_range, comments in is_list_like

renames arrays.timedelta --> arrays.timedeltas to match core.indexes

Implements comparison methods in DatetimeArray and TimedeltaArray, cleans up some Index code that is no longer needed as a result.

Makes some progress on sharing code between TDI and DTI constructors (most of which we want to move up to the array classes)

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Clean

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=h1) Report
> Merging [#21872](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/bdb61688aa80a6ec9bdb6832946dd83ab4b4c9c8?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `98.23%`.

[![Impacted file tree graph](https://codecov.io/gh/pandas-dev/pandas/pull/21872/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #21872      +/-   ##
==========================================
+ Coverage   91.91%   91.92%   +<.01%     
==========================================
  Files         164      164              
  Lines       49992    50040      +48     
==========================================
+ Hits        45952    46001      +49     
+ Misses       4040     4039       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.31% <98.23%> (+0.01%)` | :arrow_up: |
| #single | `42.22% <79.41%> (+0.06%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.4% <ø> (-0.18%)` | :arrow_down: |
| [pandas/core/dtypes/inference.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2luZmVyZW5jZS5weQ==) | `98.41% <ø> (ø)` | :arrow_up: |
| [pandas/core/arrays/\_\_init\_\_.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL19faW5pdF9fLnB5) | `100% <100%> (ø)` | :arrow_up: |
| [pandas/tseries/frequencies.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvZnJlcXVlbmNpZXMucHk=) | `95.9% <100%> (ø)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `91.35% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZWxpa2UucHk=) | `97.35% <100%> (+0.41%)` | :arrow_up: |
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `91.53% <100%> (-0.65%)` | :arrow_down: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.16% <100%> (-0.18%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `96.12% <100%> (+0.67%)` | :arrow_up: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `94.06% <95.65%> (+0.38%)` | :arrow_up: |
| ... and [2 more](https://codecov.io/gh/pandas-dev/pandas/pull/21872/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=footer). Last update [bdb6168...935ac7b](https://codecov.io/gh/pandas-dev/pandas/pull/21872?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Ping.  I’d like to get a move on #21907 and the caching issues that will come up with this.
thanks @jbrockmendel