ENH: Add the decimal.Decimal type to infer_dtypes (#15690)
State: closed

 - [x] closes #15690 
 - [x] tests added / passed
 - [x] passes ``git diff upstream/master --name-only -- '*.py' | flake8 --diff``
 - [x] whatsnew entry

Labels:
name: Enhancement
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
What I am wondering is what are potential consequences of this change. As there are quite some places in the codebase where we wheck if the inferred type is 'mixed', which could lead to potential changes in behaviour for objects with Decimals with this change. 
But don't know if those cases in the code would be relevant for Decimal objects.
https://travis-ci.org/pandas-dev/pandas/jobs/234948322#L1392 failed one of the vector resizing tests (`Test for memory errors after internal vector reallocations`), but only on the Python 3.6 run. Any ideas on how that would be related to this? The parameter it failed on seems to just be int64.
@jorisvandenbossche are there places where we explicitly check `== 'mixed'`? I haven't been able to find in just grepping (other than tests).

@margaret I'm not able to reproduce that. I'll restart that worker.

According to my pycharm search, there are 13 occurrences of 'mixed' (usage as a string constant)
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/16426?src=pr&el=h1) Report
> Merging [#16426](https://codecov.io/gh/pandas-dev/pandas/pull/16426?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/49ec31bbaeca81a6f58fc1be26fe80f3ac188cdd?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff             @@
##           master   #16426      +/-   ##
==========================================
- Coverage   90.42%   90.42%   -0.01%     
==========================================
  Files         161      161              
  Lines       51023    51023              
==========================================
- Hits        46138    46137       -1     
- Misses       4885     4886       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `88.26% <ø> (-0.01%)` | :arrow_down: |
| #single | `40.17% <ø> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/16426?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/common.py](https://codecov.io/gh/pandas-dev/pandas/pull/16426?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvY29tbW9uLnB5) | `91.05% <0%> (-0.34%)` | :arrow_down: |

------

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

If the suite passes this is prob ok. The times when we infer are: 

1) construction (IOW we have something like ``Series([Decimal(..), Decimal(..)])``, but since ``decimal`` is an object dtype this won't matter (IOW, we don't specially handle it so it will fall thru as object anyhow).

2) indexing, with an *Index* of decimals. but again its the same as above, we don't do anything special. so I think ok for now. 
One further thought: would we like to call this `"mixed-decimal"` ? (or "object-decimal", but we seem to use 'mixed' as general indicator for object dtyped columns) 
This is more explicit in the fact that it is still object dtype (since we don't have a decimal dtype, nor do we plan to have one), but lets you specifically check for decimals, and also let's you more easily test for object dtypes in general (`"mixed" in inferred_dtype`, instead of `inferred_dtype` in ['decimal', 'mixed', 'mixed-..', ..]`)
i think decimal is just fine ; don't need to get more complicated
lgtm. ping on green.
thanks!