CLN: Use ABCs in set_index
State: closed

This follows up on #25085, where part of #22486 was reverted for 0.24.1 due to #24969.

This PR is independent from #24984, and re-adds the ABC-classes in the instance-checks that was originally required in #22236 and then realised in #22486.

There's also some slight reshuffling due to redundant instance-checks, and the somewhat confusing structure that all but the last array get added in the if-branches.


Labels:
name: Clean

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

```diff
@@            Coverage Diff             @@
##           master   #25128      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52408    52403       -5     
==========================================
- Hits        48411    48406       -5     
  Misses       3997     3997
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.79% <100%> (-0.01%)` | :arrow_down: |
| #single | `42.86% <66.66%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25128?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25128/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.8% <100%> (-0.01%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/25128?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/25128?src=pr&el=footer). Last update [d3c9d6e...1011b23](https://codecov.io/gh/pandas-dev/pandas/pull/25128?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/25128?src=pr&el=h1) Report
> Merging [#25128](https://codecov.io/gh/pandas-dev/pandas/pull/25128?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/d3c9d6e67491caf9046b0f8efd2d8d153b52b8e3?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/25128/graphs/tree.svg?width=650&token=eZ4WkYLtcO&height=150&src=pr)](https://codecov.io/gh/pandas-dev/pandas/pull/25128?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master   #25128      +/-   ##
==========================================
- Coverage   92.37%   92.37%   -0.01%     
==========================================
  Files         166      166              
  Lines       52408    52403       -5     
==========================================
- Hits        48411    48406       -5     
  Misses       3997     3997
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.79% <100%> (-0.01%)` | :arrow_down: |
| #single | `42.86% <66.66%> (ø)` | :arrow_up: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/25128?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/25128/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `96.8% <100%> (-0.01%)` | :arrow_down: |

------

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

thanks