Skip to content

Openpyxl iter_rows is no more compatible with next function #13151

Closed
@mutricyl

Description

@mutricyl

The following was fine with mypy until types-openpyxl-3.1.5.20241114:

next(wb[sheet].iter_rows(...)

But when I upgraded to types-openpyxl-3.1.5.20241126 I have the following error:

error: Argument 1 to "next" has incompatible type "Generator[tuple[Cell | MergedCell, ...], None, None] | Generator[tuple[str | float | datetime | None, ...], None, None]"; expected "SupportsNext[tuple[str | float | datetime | int | None | Cell, ...]]"  [arg-type]

I do not understand why a Generator is not considered as SupportsNext ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions