Skip to content

behavior of .windows when window size exceeds iterator length #13

Open
@bakkot

Description

@bakkot

What happens if you do [1, 2].values().windows(3)?

Current spec says this gives you an empty iterator (i.e., no windows at all). As the readme documents, behavior in other languages varies.

My intuition is that it's weird to drop items, but it's also weird to yield a too-small window. I'm not sure what the right behavior is. Throwing is a possibility.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions