Move constructor helpers to EAMixins
State: closed

Takes the place of #21843, porting constructor helpers.  While this is in review I'm going to start porting tests in earnest.

Labels:
name: Refactor
description: Internal refactoring of code
name: Datetime
description: Datetime data dtype
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/21845?src=pr&el=h1) Report
> Merging [#21845](https://codecov.io/gh/pandas-dev/pandas/pull/21845?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/5d0daa0522730a6f999ceaf328f63f03dd62d0b4?src=pr&el=desc) will **decrease** coverage by `0.01%`.
> The diff coverage is `89.56%`.

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

```diff
@@            Coverage Diff             @@
##           master   #21845      +/-   ##
==========================================
- Coverage   91.92%   91.91%   -0.02%     
==========================================
  Files         160      160              
  Lines       49906    49920      +14     
==========================================
+ Hits        45875    45882       +7     
- Misses       4031     4038       +7
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.29% <89.56%> (-0.02%)` | :arrow_down: |
| #single | `42.1% <41.2%> (-0.01%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21845?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/21845/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `93.2% <ø> (-1.04%)` | :arrow_down: |
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/21845/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `92.17% <100%> (+1.09%)` | :arrow_up: |
| [pandas/core/arrays/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/21845/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3BlcmlvZC5weQ==) | `91.35% <100%> (+3.52%)` | :arrow_up: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/21845/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.33% <100%> (+0.12%)` | :arrow_up: |
| [pandas/core/arrays/timedelta.py](https://codecov.io/gh/pandas-dev/pandas/pull/21845/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL3RpbWVkZWx0YS5weQ==) | `85.36% <76.71%> (-7.11%)` | :arrow_down: |
| [pandas/core/arrays/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/21845/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lcy5weQ==) | `95.45% <91.66%> (-0.4%)` | :arrow_down: |

------

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

> rename _generate -> _generate_range, everything else can be future things

Will do.
Thoughts on renaming (not this PR) arrays.period --> arrays.periods and arrays.timedelta --> arrays.timedeltas?  For the core.indexes files datetimes and timedeltas are plural, period is not.
> rename _generate -> _generate_range, everything else can be future things

This caused some failures, reverted it until the next pass.
> Thoughts on renaming (not this PR) arrays.period --> arrays.periods and arrays.timedelta --> arrays.timedeltas? For the core.indexes files datetimes and timedeltas are plural, period is not.

yes this is ok (separate PR)
> This caused some failures, reverted it until the next pass.

hmm, ok sure
thanks !