REF: strictness/simplification in DatetimeArray/Index _simple_new
State: closed

Broken off of #23426.  The edits to DatetimeIndex._simple_new go beyond what is done there.

Labels:
name: Refactor
description: Internal refactoring of code
name: Datetime
description: Datetime data dtype
name: API Design

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

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

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

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

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


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

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

```diff
@@            Coverage Diff             @@
##           master   #23431      +/-   ##
==========================================
+ Coverage   92.21%   92.22%   +<.01%     
==========================================
  Files         161      161              
  Lines       51173    51174       +1     
==========================================
+ Hits        47190    47196       +6     
+ Misses       3983     3978       -5
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.66% <96.55%> (ø)` | :arrow_up: |
| #single | `42.23% <58.62%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23431?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/23431/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `92.15% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/23431/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `96.4% <100%> (-0.04%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/23431/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `98.84% <100%> (+0.94%)` | :arrow_up: |
| [pandas/core/indexes/base.py](https://codecov.io/gh/pandas-dev/pandas/pull/23431/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9iYXNlLnB5) | `96.46% <80%> (-0.16%)` | :arrow_down: |
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/23431/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `96.99% <0%> (+1.2%)` | :arrow_up: |

------

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

This (and to a lesser extent #23430) is turning into a blocker for work on DatetimeArray.

(its easy to re-implement this in that branch, but still)
thanks