BUG: Categorical.__setitem__ allows for tuple assignment
State: closed

- [x] closes #20439 
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [x] whatsnew entry

Pretty straightforward fix in the `__setitem__` method

While I was looking into this, I discovered a bug that does not allow for the creation of mixed-dtype Categoricals, if the first element is not a tuple. Should I create an issue?

```console
In [20]: s = pd.Categorical([('a', 'a'), ('a', 'b'), ('b', 'a'), 'c'])

In [21]: s
Out[21]:
[(a, a), (a, b), (b, a), c]
Categories (4, object): [(a, a), (a, b), (b, a), c]

In [22]: s = pd.Categorical(['c', ('a', 'b'), ('b', 'a'), 'c'])
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-22-0f4b5f338532> in <module>()
----> 1 s = pd.Categorical(['c', ('a', 'b'), ('b', 'a'), 'c'])

~/Documents/siv-dev/projects/open-source/pandas/pandas/core/arrays/categorical.py in __init__(self, values, categories, ordered, dtype, fastpath)
    328             # _sanitize_array coerces np.nan to a string under certain versions
    329             # of numpy
--> 330             values = maybe_infer_to_datetimelike(values, convert_dates=True)
    331             if not isinstance(values, np.ndarray):
    332                 values = _convert_to_list_like(values)

~/Documents/siv-dev/projects/open-source/pandas/pandas/core/dtypes/cast.py in maybe_infer_to_datetimelike(value, convert_dates)
    893     if not is_list_like(v):
    894         v = [v]
--> 895     v = np.array(v, copy=False)
    896
    897     # we only care about object dtypes

ValueError: setting an array element with a sequence
```

Labels:
name: Enhancement
name: Categorical
description: Categorical Data Type

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

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

```diff
@@            Coverage Diff             @@
##           master   #21412      +/-   ##
==========================================
+ Coverage   91.89%    91.9%   +<.01%     
==========================================
  Files         153      153              
  Lines       49600    49603       +3     
==========================================
+ Hits        45580    45586       +6     
+ Misses       4020     4017       -3
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.3% <100%> (ø)` | :arrow_up: |
| #single | `41.89% <60%> (+0.03%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/21412?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/21412/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `95.71% <100%> (+0.01%)` | :arrow_up: |
| [pandas/tseries/offsets.py](https://codecov.io/gh/pandas-dev/pandas/pull/21412/diff?src=pr&el=tree#diff-cGFuZGFzL3RzZXJpZXMvb2Zmc2V0cy5weQ==) | `97.24% <0%> (+0.24%)` | :arrow_up: |

------

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

> Should I create an issue?

@alysivji : Yes, by all means!
With the 0.23.1 release last night, moved my whatsnew entry to 0.23.2