Skip to content

Error for len or enumerate on array.array #1608

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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