JuliaCollections / JuliaCollections/IterTools.jl

Differences in `Base.Iterators.partition` and `IterTools.partition`

Open
#67 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
160
Forks
30
PR merge metrics
No merged PRs in 30d

Description

There are some differences between Base.Iterators.partition and IterTools.partition. I brought it up on Slack and @oxinabox asked me to file an issue.

  1. Base.Iterators.partition returns each chunk as an Array, whereas IterTools.partition returns a Tuple
  2. In the case that the last chunk is smaller than the requested partition size, Base.Iterators.partition returns a shorter chunk, whereas IterTools.partition drops the last values.
  3. IterTools.partition accepts a step argument that determines the hop size for each chunk.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named. Start by locating the implementations and tests for Base.Iterators.partition and IterTools.partition, then compare their chunk types, handling of the final chunk, and step behavior. Done means the intended relationship between the two APIs is decided and the relevant behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend-api-design
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.