API: Allow ordered=None in CategoricalDtype
State: closed

- [X] closes #18790
- [X] tests added / passed
- [X] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [X] whatsnew entry

For equality comparisons with `ordered=None`, I essentially treated it as if it where `ordered=False`:

  - `CDT(['a', 'b'], None) == CDT(['a', 'b'], False)` --> `True`
  - `CDT(['a', 'b'], None) == CDT(['b', 'a'], False)` --> `True`
  - `CDT(['a', 'b'], None) == CDT(['a', 'b'], True)` --> `False`

This maintains existing comparison behavior when ordered is not specified:
  - `CDT(['a', 'b'], False) == CDT(['a', 'b'])`  --> `True`
  - `CDT(['a', 'b'], True) == CDT(['a', 'b'])`  --> `False`
<br />

I didn't make any code modifications in regards to hashing, so `CDT(*, None)` will have the same hash as `CDT(*, False)`.  This seems to be consistent with how equality is treated.  Makes the logic implementing equality nicer too, since the case when both dtypes are unordered relies on hashes.

Labels:
name: API Design
name: Categorical
description: Categorical Data Type

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/18889?src=pr&el=h1) Report
> Merging [#18889](https://codecov.io/gh/pandas-dev/pandas/pull/18889?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/6485a36483884fb817800a8380a4a4197d6df4ad?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/18889/graphs/tree.svg?width=650&height=150&src=pr&token=eZ4WkYLtcO)](https://codecov.io/gh/pandas-dev/pandas/pull/18889?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #18889      +/-   ##
==========================================
+ Coverage   91.62%   91.62%   +<.01%     
==========================================
  Files         150      150              
  Lines       48798    48798              
==========================================
+ Hits        44709    44711       +2     
+ Misses       4089     4087       -2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.99% <100%> (ø)` | :arrow_up: |
| #single | `41.74% <90%> (+0.01%)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/18889?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/arrays/categorical.py](https://codecov.io/gh/pandas-dev/pandas/pull/18889/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2NhdGVnb3JpY2FsLnB5) | `94.87% <100%> (ø)` | :arrow_up: |
| [pandas/core/indexes/category.py](https://codecov.io/gh/pandas-dev/pandas/pull/18889/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9jYXRlZ29yeS5weQ==) | `97.26% <100%> (ø)` | :arrow_up: |
| [pandas/core/dtypes/dtypes.py](https://codecov.io/gh/pandas-dev/pandas/pull/18889/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2R0eXBlcy5weQ==) | `96.08% <100%> (ø)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/18889/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `83.85% <0%> (+0.2%)` | :arrow_up: |

------

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

@jreback @TomAugspurger :  Sorry, forgot about this!  Made the requested changes.
thanks @jschendel as always very nice patches! keep coming!

IF you are interested in working on some of the new interval indexing things (the _new test files), would be great.