Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH677 Allow pd.RangeIndex to be initialized with range #1005

Merged
merged 2 commits into from
Sep 22, 2024

Conversation

loicdiridollou
Copy link
Contributor

@loicdiridollou
Copy link
Contributor Author

/pandas_nightly

Copy link
Member

@twoertwein twoertwein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to merge or wait if you want to remove __init__ first

@loicdiridollou
Copy link
Contributor Author

Happy to merge or wait if you want to remove __init__ first

I deleted the __init__ method, just waiting for CI to finish but it is looking ready from a code perspective.

@twoertwein twoertwein merged commit 1bc27e6 into pandas-dev:main Sep 22, 2024
10 checks passed
@twoertwein
Copy link
Member

Thanks @loicdiridollou !

@loicdiridollou loicdiridollou deleted the gh677_range_index branch September 22, 2024 23:08
@Dr-Irv
Copy link
Collaborator

Dr-Irv commented Sep 24, 2024

FYI, I think we should have kept __init__() and deleted __new__(). In the stubs, we only need to have __new__() if we want to have different overloads that produce different results. Otherwise __init__() is sufficient.

Admittedly, we're inconsistent in the stubs about that. There are times we use __new__() instead of __init__()

@twoertwein
Copy link
Member

Admittedly, we're inconsistent in the stubs about that. There are times we use __new__() instead of __init__()

If we want to become more stubtest compatible (aligning pandas and pandas-stubs), we should use which ever constructor pandas uses, at least when possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd.RangeIndex should accept range as the first argument
3 participants