DEPR: Deprecate passing range-like arguments to DatetimeIndex, TimedeltaIndex
State: closed

Also `verify_integrity` since allowing that to be False complicates things, and internally if its False we should be using simple_new anyway

- [x] closes #20535
- [ ] tests added / passed
- [ ] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry


Labels:
name: Datetime
description: Datetime data dtype
name: API Design
name: Deprecate
description: Functionality to remove in pandas

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

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

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

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

 - There are no PEP8 issues in the file [`pandas/tests/frame/test_indexing.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/frame/test_indexing.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_groupby.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/groupby/test_groupby.py) !

 - There are no PEP8 issues in the file [`pandas/tests/groupby/test_timegrouper.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/groupby/test_timegrouper.py) !

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

 - There are no PEP8 issues in the file [`pandas/tests/io/formats/test_to_html.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/io/formats/test_to_html.py) !

 - There are no PEP8 issues in the file [`pandas/tests/io/parser/test_parse_dates.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/io/parser/test_parse_dates.py) !

 - There are no PEP8 issues in the file [`pandas/tests/plotting/test_datetimelike.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/plotting/test_datetimelike.py) !

 - There are no PEP8 issues in the file [`pandas/tests/reshape/merge/test_merge_asof.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/reshape/merge/test_merge_asof.py) !

 - There are no PEP8 issues in the file [`pandas/tests/reshape/test_concat.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/reshape/test_concat.py) !

 - There are no PEP8 issues in the file [`pandas/tests/series/indexing/test_datetime.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/series/indexing/test_datetime.py) !

 - There are no PEP8 issues in the file [`pandas/tests/series/test_datetime_values.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/series/test_datetime_values.py) !

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

 - There are no PEP8 issues in the file [`pandas/tests/tseries/offsets/test_offsets.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tests/tseries/offsets/test_offsets.py) !

 - There are no PEP8 issues in the file [`pandas/tseries/holiday.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/tseries/holiday.py) !

 - There are no PEP8 issues in the file [`pandas/util/testing.py`](https://github.com/jbrockmendel/pandas/blob/f8bed85eb5990993ef42b8ca6e87cc823ccf1869/pandas/util/testing.py) !


# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/23919?src=pr&el=h1) Report
> :exclamation: No coverage uploaded for pull request base (`master@30c1290`). [Click here to learn what that means](https://docs.codecov.io/docs/error-reference#section-missing-base-commit).
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff            @@
##             master   #23919   +/-   ##
=========================================
  Coverage          ?   92.31%           
=========================================
  Files             ?      161           
  Lines             ?    51489           
  Branches          ?        0           
=========================================
  Hits              ?    47533           
  Misses            ?     3956           
  Partials          ?        0
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.71% <100%> (?)` | |
| #single | `42.43% <53.33%> (?)` | |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/23919?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/23919/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `86.09% <100%> (ø)` | |
| [pandas/core/resample.py](https://codecov.io/gh/pandas-dev/pandas/pull/23919/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvcmVzYW1wbGUucHk=) | `96.99% <100%> (ø)` | |
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/23919/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `88.08% <100%> (ø)` | |
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/23919/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `89.44% <100%> (ø)` | |
| [pandas/tseries/holiday.py](https://codecov.io/gh/pandas-dev/pandas/pull/23919/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvaG9saWRheS5weQ==) | `93.17% <100%> (ø)` | |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/23919/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `96.51% <100%> (ø)` | |

------

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

lgtm
circle fail is Hypothesis; de-facto green
Shouldn't we do the same for `PeriodIndex` as well?
> Shouldn't we do the same for PeriodIndex as well?

Possibly.  There are also `fields` kwargs there we might want to deprecate.  Prefer to do this separately.
@jorisvandenbossche 
thanks!