Skip to content

pd.array().tolist() is not recognized #583

@andsav

Description

@andsav

Describe the bug

.tolist() is not recognized as a method for a pandas array. You can compare with generating the stubs using stubgen -p pandas which does provide it in core/arrays/base.pyi:

class ExtensionArray:
  ....
  def tolist(self) -> list: ...

Should pandas-stub support this? Could be something wrong with my typechecker, but I don't see tolist in the corresponding pandas-stubs' pyi.

To Reproduce

import pandas as pd
return pd.array([1,2,3]).tolist()

image

Please complete the following information:

  • python version: 3.10.8
  • version of type checker: fork of pyright. Should be compatible with pyright 1.1.279
  • version of installed pandas-stubs: 1.5.3.230304

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