Implement mul, floordiv, mod, divmod, and reversed directly in TimedeltaArray
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Companion to #23829, will need rebasing after that goes through.  Some overlap with #23789; this will have a smaller diff after being rebased on top of that.

Labels:
name: Refactor
description: Internal refactoring of code
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Timedelta
description: Timedelta data type

Comments:
Hello @jbrockmendel! Thanks for submitting the PR.

 - There are no PEP8 issues in the file [`pandas/core/arrays/timedeltas.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/core/arrays/timedeltas.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/base.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/core/indexes/base.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/datetimelike.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/core/indexes/datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/core/indexes/timedeltas.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/core/indexes/timedeltas.py) !

 - There are no PEP8 issues in the file [`pandas/core/ops.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/core/ops.py) !

 - There are no PEP8 issues in the file [`pandas/tests/arithmetic/test_datetime64.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/tests/arithmetic/test_datetime64.py) !

 - There are no PEP8 issues in the file [`pandas/tests/arithmetic/test_timedelta64.py`](https://github.com/jbrockmendel/pandas/blob/62d2018e8da1ca27de915c849dc4e8e4e38ec4c3/pandas/tests/arithmetic/test_timedelta64.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23885?src=pr&el=h1) Report
> Merging [#23885](https://codecov.io/gh/pandas-dev/pandas/pull/23885?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/022f458ee858721d366c27dd88940d69383ab960?src=pr&el=desc) will **decrease** coverage by `49.94%`.
> The diff coverage is `17.94%`.

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

```diff
@@             Coverage Diff             @@
##           master   #23885       +/-   ##
===========================================
- Coverage   92.31%   42.36%   -49.95%     
===========================================
  Files         161      161               
  Lines       51562    51669      +107     
===========================================
- Hits        47599    21891    -25708     
- Misses       3963    29778    +25815
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `?` | |
| #single | `42.36% <17.94%> (-0.08%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23885?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `55.2% <ø> (-38.94%)` | :arrow_down: |
| [pandas/core/indexes/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZWxpa2UucHk=) | `53.35% <33.33%> (-44.07%)` | :arrow_down: |
| [pandas/core/arrays/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3RpbWVkZWx0YXMucHk=) | `38.96% <5.55%> (-57.04%)` | :arrow_down: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `55.91% <71.42%> (-40.42%)` | :arrow_down: |
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `40.84% <75%> (-49.28%)` | :arrow_down: |
| [pandas/io/formats/latex.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvbGF0ZXgucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/core/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY2F0ZWdvcmljYWwucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/io/sas/sas\_constants.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3Nhcy9zYXNfY29uc3RhbnRzLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/plotting.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvcGxvdHRpbmcucHk=) | `0% <0%> (-100%)` | :arrow_down: |
| [pandas/tseries/converter.py](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvY29udmVydGVyLnB5) | `0% <0%> (-100%)` | :arrow_down: |
| ... and [124 more](https://codecov.io/gh/pandas-dev/pandas/pull/23885/diff?src=pr&el=tree-more) | |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23885?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/23885?src=pr&el=footer). Last update [022f458...987eecd](https://codecov.io/gh/pandas-dev/pandas/pull/23885?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

Broader question here: given the amount of moving parts in different PR's, to what extent is your implementations in this PR tested (or will be tested)?  I ask because I see a lot of branching logic, but I'm uncertain as to how many of the branches are covered.
> Broader question here: given the amount of moving parts in different PR's, to what extent is your implementations in this PR tested (or will be tested)? I ask because I see a lot of branching logic, but I'm uncertain as to how many of the branches are covered.

I've tried to keep these non-overlapping.  This PR should definitely wait until after #23829 and #23789.

While there is always room for improvement in the tests, the existing tests in test_timedelta64 cover these methods pretty well.

can you rebase
rebased+green
thanks @jbrockmendel 

same comment as on other PR.s let's really really try to limit code adding.
> let's really really try to limit code adding.

Sounds good.  This was the last PR I had for TimedeltaArray.  The only one I have left for DatetimeArray is to implement DatetimeArray._from_sequence.  Following that, all I have on my plate is a) to_datetime/array_to_datetime improvements, b) parametrizing+de-duplicating arithmetic tests, and c) DTA/TDA/PA reductions.  All three can wait until after 0.24.0.