Skip to content

Add mapacc: combined map and accumulate (#529) - #632

Open
az51826295-sys wants to merge 4 commits into
pytoolz:masterfrom
az51826295-sys:add-mapacc
Open

Add mapacc: combined map and accumulate (#529)#632
az51826295-sys wants to merge 4 commits into
pytoolz:masterfrom
az51826295-sys:add-mapacc

Conversation

@az51826295-sys

Copy link
Copy Markdown

Implements the map+accumulate combination requested in #529: apply a mapper while threading an accumulator through the sequence, returning both the mapped elements and the successive accumulator states.

Includes a doctest based on the issue example and tests in tests/test_itertoolz.py (including the empty-sequence case). Full test suite passes locally.

Disclosure: the initial implementation was produced by an AI coding agent and then human-reviewed; tests and doctest verified locally.

Closes #529

intake and others added 4 commits August 20, 2026 22:14
Implements the map+accumulate combination requested in pytoolz#529: apply a
mapper while threading an accumulator through the sequence, returning
both the mapped elements and the successive accumulator states.

Includes docstring with a doctest based on the issue example, and
tests in tests/test_itertoolz.py (including the empty-sequence case).

Co-Authored-By: Rookery Alpha (AI agent, human-reviewed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combination of map and accumulate

1 participant