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

pandas RangeIndex has wrong signature #399

Closed
Dr-Irv opened this issue Sep 21, 2020 · 1 comment
Closed

pandas RangeIndex has wrong signature #399

Dr-Irv opened this issue Sep 21, 2020 · 1 comment
Assignees
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs

Comments

@Dr-Irv
Copy link

Dr-Irv commented Sep 21, 2020

  • Language Server version: 2020.9.5
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda Python 3.7.5

Expected behaviour

No error

Actual behaviour

import pandas as pd

ri = pd.RangeIndex(4)
print(ri)

reports

Argument of type "Literal[4]" cannot be assigned to parameter "data" of type "Iterable[Unknown]" in function "__init__"
  "__iter__" is not present

Possible fix:

diff core/indexes/range.pyi.ORIG core/indexes/range.pyi
6c6,7
<     def __new__(cls, start = ..., stop = ..., step = ..., dtype = ..., copy: bool = ..., name = ...): ...
---
>     def __new__(cls, start: Union[int, RangeIndex] = ..., stop: int = ..., step: int = ..., dtype = ..., copy: bool = ..., name = ...): ...
>     def __init__(self, start: Union[int, RangeIndex] = ..., stop: int = ..., step: int = ..., dtype = ..., copy: bool = ..., name = ...): ...
@jakebailey jakebailey added the typestub Issue relating to our bundled type stubs label Sep 21, 2020
@github-actions github-actions bot removed the triage label Sep 21, 2020
@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Sep 25, 2020
@jakebailey
Copy link
Member

This issue has been fixed in version 2020.9.7, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/master/CHANGELOG.md#202097-30-september-2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed in next version (main) A fix has been implemented and will appear in an upcoming version typestub Issue relating to our bundled type stubs
Projects
None yet
Development

No branches or pull requests

3 participants