ENH: Let initialisation from dicts use insertion order for python >= 3.6 (part II)
State: closed

- [x] xref #19018 and #19830
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`

This PR is the second part of the preparation for allowing initialisation using insertion order for python>=3.6. See cross-referenced issues for details.

After this PR all tests will pass independent of dict initialisation rule, and then core/frame.py and core/series.py will be changed in the next PR to use insertion order for python>=3.6.

Labels:
name: Enhancement
name: API Design

Comments:
@jreback : Do we need a deprecation cycle on this given that it's an API change?
the error message for travis-ci is:

> The job exceeded the maximum time limit for jobs, and has been terminated.

So, nothing to do with my PR. Should I run again, or is there an issue with travis?
Wrt. deprecation cycle, IMO this change must be very clearly documented, but IMO we mirror Python itself, and if Python can do this change without deprecation cycles, pandas can too...

OTOH, I could add a option to pd.options, where users can switch back to the old behaviour. That option could then be marked for deprecation. So people can revert back manually, but then be told that the option to revert will be removed in the future?
this is just reordering tests there is no actual change here.

lgtm. ping on green.
I restarted the builds that timed out.

> we mirror Python itself, and if Python can do this change without deprecation cycles, pandas can too...

The difference was that dictionary order was previously unspecified, whereas we explicitly sorted.

But we can discuss if / how to deprecate things elsewhere.
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19859?src=pr&el=h1) Report
> Merging [#19859](https://codecov.io/gh/pandas-dev/pandas/pull/19859?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/572476f0a3652222c17458d418a107554580eaa5?src=pr&el=desc) will **increase** coverage by `0.08%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #19859      +/-   ##
==========================================
+ Coverage   91.58%   91.67%   +0.08%     
==========================================
  Files         150      150              
  Lines       48908    48946      +38     
==========================================
+ Hits        44793    44870      +77     
+ Misses       4115     4076      -39
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.05% <ø> (+0.08%)` | :arrow_up: |
| #single | `41.81% <ø> (+0.03%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19859?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/dtypes/dtypes.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2R0eXBlcy5weQ==) | `95.9% <0%> (-0.19%)` | :arrow_down: |
| [pandas/core/indexes/period.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9wZXJpb2QucHk=) | `92.7% <0%> (-0.18%)` | :arrow_down: |
| [pandas/core/indexes/datetimes.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9kYXRldGltZXMucHk=) | `95.47% <0%> (-0.09%)` | :arrow_down: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `94.41% <0%> (-0.05%)` | :arrow_down: |
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `95.7% <0%> (-0.04%)` | :arrow_down: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97.23% <0%> (-0.01%)` | :arrow_down: |
| [pandas/core/dtypes/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2dlbmVyaWMucHk=) | `100% <0%> (ø)` | :arrow_up: |
| [pandas/core/generic.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZ2VuZXJpYy5weQ==) | `95.93% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexes/timedeltas.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy90aW1lZGVsdGFzLnB5) | `90.63% <0%> (ø)` | :arrow_up: |
| [pandas/core/indexing.py](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhpbmcucHk=) | `93.02% <0%> (ø)` | :arrow_up: |
| ... and [10 more](https://codecov.io/gh/pandas-dev/pandas/pull/19859/diff?src=pr&el=tree-more) | |

------

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

Green.

Thanks for restarting @TomAugspurger.
Should we add a `whatsnew` for this change?  Otherwise, LGTM.
@gfyoung , not for this PR (no functional changes here), but the next PR, where changes will be made, a whatsnew should be added.
thanks @topper-123