Skip to content

Error for len or enumerate on array.array #1608

Closed
@Zac-HD

Description

@Zac-HD

array.array objects are essentially efficient lists with a single element type. They have a size and can be iterated over, but mypy doesn't seem to know this:

floats.py:105: error: Argument 1 to "len" has incompatible type "array"; expected "Sized"
floats.py:107: error: Argument 1 to "enumerate" has incompatible type "array"; expected Iterable[<nothing>]

Source.

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