• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

aio-libs / multidict / 35914322178
87%

Build:
DEFAULT BRANCH: master
Ran 23 Sep 2026 08:12PM UTC
Jobs 1
Files 42
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

23 Sep 2026 08:11PM UTC coverage: 87.436% (-0.004%) from 87.44%
35914322178

push

github

web-flow
Walk every entry directly in MultiDict_ForEach (#1544)

<!-- Thank you for your contribution! -->

## What do these changes do?

`_md_foreach_all()` drove `md_next()`, the cursor `iter.h` uses for
`__next__`. There each step re-enters the critical section, so the
cursor has
to re-check the version, re-read `md->keys` and recompute the entry
array on
every call, and it writes three out-parameters of which this caller
wants
two. A caller that holds the section for the whole walk needs none of
that.

`md_walk_all()` puts the linear scan next to `md_walk()`, sharing its
visitor
contract and its post-visitor staleness check. That check is also
stricter
than what the old loop had: it compares `md->keys` as well as the
version.

The reentrancy guard the walk promises had no test, so both harnesses
gained
a visitor that adds to the multidict being walked, covering it for the
whole-table walk and for the single-key one.

The other leg, `_md_foreach_key()`, is unchanged: `md_walk()` is seeded
from
a hash, filters on `entry->hash` and `_str_cmp`, and carries a seen set
that
exists only because a probe chain can revisit a slot. A linear scan
needs
none of those, so the two traversals stay separate.

## Are there changes in behavior for the user?

No.

## Is it a substantial burden for the maintainers to support this?

No. `_md_foreach_all()` drops from 24 lines to 5, and both legs of
`MultiDict_ForEach()` now go through `walk.h`.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [ ] Documentation reflects the changes — N/A, no user-visible API
change
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` — N/A, no such file in this repo
- [x] Add a new news fragment into the `CHANGES/` folder
- [x] `make doc-spelling` passes and any new technical words are added
to `docs/spelling_wordlist.txt`

<details>
<summary>Agent run details (optional, for reviewers)</summa... (continued)

765 of 1530 branches covered (50.0%)

Branch coverage included in aggregate %.

4 of 5 new or added lines in 1 file covered. (80.0%)

7294 of 7687 relevant lines covered (94.89%)

1.9 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
75.4
0.06% tests/test_capi.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 35914322178.1 23 Sep 2026 08:12PM UTC 84
87.43
GitHub Action Run
Source Files on build 35914322178
  • Tree
  • List 42
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #35914322178
  • 9682ba17 on github
  • Prev Build on master (#35913838361)
  • Next Build on master (#35963992961)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc