Skip to content

BUG: iter(Series.str) does not raise a TypeError  #54173

Closed
@mroeschke

Description

@mroeschke

Pandas version checks

  • I have checked that this issue has not already been reported.

  • I have confirmed this bug exists on the latest version of pandas.

  • I have confirmed this bug exists on the main branch of pandas.

Reproducible Example

In [1]: import pandas as pd

In [2]: ser = pd.Series(("google", "wikimedia", "wikipedia", "wikitravel"))

In [3]: list(iter(ser.str)) # hangs

Issue Description

#49268 removed StringMethods.__iter__, but user can still iterate over Series(...).str which indefinitely hangs

Expected Behavior

Raises TypeError

Installed Versions

Replace this line with the output of pd.show_versions()

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugStringsString extension data type and string data

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions