Skip to content

pd.RangeIndex should accept range as the first argument #677

@Daverball

Description

@Daverball

Describe the bug
Both according to the docs and the implementation it is valid to pass a python range object as the first argument to pd.RangeIndex

To Reproduce

import pandas as pd

pd.RangeIndex(range(5))  # mypy: arg-type – Argument 1 to "RangeIndex" has incompatible type "range"

Please complete the following information:

  • OS: Linux (OpenSUSE Tumbleweed)
  • Python 3.10
  • mypy 1.0.1
  • pandas-stubs 2.0.1.230501

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions