Simplify bool ops closures, improve tests
State: closed

Series bool ops are not going to be possible to dispatch to their Index counterparts, so this one I'm _mostly_ going to leave alone.  This breaks up the tests, adds an xfail for op(Series, Categorical), and fixes+tests op(series, Index).  It makes some headway in simplifying the closure so the possible paths through the code are more obvious.

There is a TODO comment on line 1113 where I think there is a potential bug, but need someone who understands the _intended_ behavior better to weigh in.

Labels:
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Dtype Conversions
description: Unexpected or buggy dtype conversions

Comments:
> how about we do the tests with appropriate xfails separately. it is really confusing what you are actually changing.

OK
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/19795?src=pr&el=h1) Report
> Merging [#19795](https://codecov.io/gh/pandas-dev/pandas/pull/19795?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/740ad9aabda113e34de0d30c78b8aec40414daf7?src=pr&el=desc) will **decrease** coverage by `<.01%`.
> The diff coverage is `100%`.

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

```diff
@@            Coverage Diff             @@
##           master   #19795      +/-   ##
==========================================
- Coverage   91.61%    91.6%   -0.01%     
==========================================
  Files         150      150              
  Lines       48887    48891       +4     
==========================================
+ Hits        44786    44789       +3     
- Misses       4101     4102       +1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `89.98% <100%> (-0.01%)` | :arrow_down: |
| #single | `41.8% <65.38%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19795?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/19795/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `96.93% <100%> (+0.18%)` | :arrow_up: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/19795/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `83.64% <0%> (-0.21%)` | :arrow_down: |

------

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

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

```diff
@@            Coverage Diff             @@
##           master   #19795      +/-   ##
==========================================
+ Coverage   91.66%   91.66%   +<.01%     
==========================================
  Files         150      150              
  Lines       49026    49031       +5     
==========================================
+ Hits        44939    44945       +6     
+ Misses       4087     4086       -1
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.04% <100%> (ø)` | :arrow_up: |
| #single | `41.83% <65.21%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/19795?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/ops.py](https://codecov.io/gh/pandas-dev/pandas/pull/19795/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvb3BzLnB5) | `97.11% <100%> (+0.17%)` | :arrow_up: |

------

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

needs a rebase and I have yet to actually review
Reverted some suggested changes because I'm not confident they handle Categorical correctly.  Until the tests+docs for these methods are fleshed out, sticking to cleanup without changing behavior.
needs a rebase on master. note *always* rebase when pushing.
there is likely an issue for this already, see if you can find it