CLN:  use RangeIndex._range instead of RangeIndex._start etc.
State: closed

- [x] xref #26565
- [x] tests added / passed
- [x] passes `git diff upstream/master -u -- "*.py" | flake8 --diff`
- [ ] whatsnew entry

Make RangeIndex use python's ``range`` internally, rather than the three scalars ``_start``, ``_stop``  and ``_step``.

Python3's ``range`` has several nice properties, that were not available in ``xrange`` in Python2. For example it's sliceable, and has ``.index`` and ``count`` and various magic methods. These can be used in Pandas, rather than maintaining Pandas-specific code, offering cleaner code and possibly faster operations.


Labels:
name: Clean
name: Index
description: Related to the Index class or subclasses

Comments:
# [Codecov](https://codecov.io/gh/pandas-dev/pandas/pull/26578?src=pr&el=h1) Report
> Merging [#26578](https://codecov.io/gh/pandas-dev/pandas/pull/26578?src=pr&el=desc) into [master](https://codecov.io/gh/pandas-dev/pandas/commit/7c8041b9b6dd44a7388bc8518dc0cd2f7303c2d2?src=pr&el=desc) will **decrease** coverage by `0.12%`.
> The diff coverage is `37.83%`.

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

```diff
@@            Coverage Diff             @@
##           master   #26578      +/-   ##
==========================================
- Coverage   41.79%   41.67%   -0.13%     
==========================================
  Files         174      174              
  Lines       50643    50617      -26     
==========================================
- Hits        21168    21094      -74     
- Misses      29475    29523      +48
```

| Flag | Coverage Δ | |
|---|---|---|
| #single | `41.67% <37.83%> (-0.13%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26578?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `14.53% <ø> (ø)` | :arrow_up: |
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `49.68% <32.81%> (-2.49%)` | :arrow_down: |
| [pandas/core/dtypes/concat.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2NvbmNhdC5weQ==) | `52.19% <70%> (-1.24%)` | :arrow_down: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `15.78% <0%> (-57.9%)` | :arrow_down: |
| [pandas/io/formats/csvs.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvY3N2cy5weQ==) | `68.07% <0%> (-1.21%)` | :arrow_down: |
| [pandas/util/testing.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL3V0aWwvdGVzdGluZy5weQ==) | `50.89% <0%> (-1.06%)` | :arrow_down: |
| [pandas/io/formats/format.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2Zvcm1hdHMvZm9ybWF0LnB5) | `50.23% <0%> (-0.94%)` | :arrow_down: |
| [pandas/core/internals/blocks.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW50ZXJuYWxzL2Jsb2Nrcy5weQ==) | `51.93% <0%> (-0.83%)` | :arrow_down: |
| [pandas/core/dtypes/cast.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2Nhc3QucHk=) | `48.59% <0%> (-0.34%)` | :arrow_down: |
| [pandas/core/arrays/datetimelike.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvYXJyYXlzL2RhdGV0aW1lbGlrZS5weQ==) | `42.78% <0%> (-0.18%)` | :arrow_down: |
| ... and [3 more](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree-more) | |

------

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

```diff
@@            Coverage Diff             @@
##           master   #26578      +/-   ##
==========================================
- Coverage   91.84%   91.84%   -0.01%     
==========================================
  Files         174      174              
  Lines       50643    50624      -19     
==========================================
- Hits        46515    46494      -21     
- Misses       4128     4130       +2
```

| Flag | Coverage Δ | |
|---|---|---|
| #multiple | `90.37% <100%> (ø)` | :arrow_up: |
| #single | `41.69% <36.7%> (-0.11%)` | :arrow_down: |

| [Impacted Files](https://codecov.io/gh/pandas-dev/pandas/pull/26578?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [pandas/io/packers.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL3BhY2tlcnMucHk=) | `88.08% <ø> (ø)` | :arrow_up: |
| [pandas/core/series.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvc2VyaWVzLnB5) | `93.61% <ø> (ø)` | :arrow_up: |
| [pandas/core/frame.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZnJhbWUucHk=) | `97% <ø> (-0.12%)` | :arrow_down: |
| [pandas/core/dtypes/concat.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvZHR5cGVzL2NvbmNhdC5weQ==) | `96.58% <100%> (+0.01%)` | :arrow_up: |
| [pandas/core/indexes/range.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2NvcmUvaW5kZXhlcy9yYW5nZS5weQ==) | `98.46% <100%> (+0.49%)` | :arrow_up: |
| [pandas/io/gbq.py](https://codecov.io/gh/pandas-dev/pandas/pull/26578/diff?src=pr&el=tree#diff-cGFuZGFzL2lvL2dicS5weQ==) | `78.94% <0%> (-10.53%)` | :arrow_down: |

------

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

Some problems, closing temporqrily.