Skip to content

API: __name__ of str.cat.methods wrong #23551

Closed
@h-vetinari

Description

@h-vetinari

While working on #23167, I found out that the names of several methods that are generated by wrappers are not set correctly (which matters because I need them for error reporting).

E.g.

>>> import pandas as pd
>>> pd.Series(['']).str.lower.__name__
'<lambda>'
>>> pd.Series(['']).str.upper.__name__
'<lambda>'
>>> pd.Series(['']).str.title.__name__
'<lambda>'
>>> pd.Series(['']).str.capitalize.__name__
'<lambda>'
>>> pd.Series(['']).str.swapcase.__name__
'<lambda>'
>>> # same for isalnum, isalpha, isdigit, isspace, islower, isupper, istitle, isnumeric, isdecimal
>>>
>>> pd.Series(['']).str.count.__name__
'str_count'
>>> pd.Series(['']).str.startswith.__name__
'str_startswith'
>>> pd.Series(['']).str.endswith.__name__
'str_endswith'
>>> pd.Series(['']).str.findall.__name__
'str_findall'

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugInternalsRelated to non-user accessible pandas implementationStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions