Skip to content

Disallow StringMethods for Series and Index when subtype is not str, but allow for Any #1159

Open
@Dr-Irv

Description

@Dr-Irv

In #1146 tried to get StringMethods to know that passing Series[float] (for example) is wrong.

I got something to work for Series with pyright . See https://github.com/Dr-Irv/pandas-stubs/tree/pr1146 and this commit: 164bc27

Would like to add this to the stubs.

But as noted here: #1146 (comment) it fails in mypy which seems to be due to python/mypy#15921

Metadata

Metadata

Assignees

No one assigned

    Labels

    mypy bugRequires mypy to fix a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions