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

aio-libs / multidict / 37330081021
86%

Build:
DEFAULT BRANCH: master
Ran 05 Oct 2026 03:07PM UTC
Jobs 1
Files 49
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

05 Oct 2026 03:05PM UTC coverage: 85.953%. Remained the same
37330081021

push

github

web-flow
Move the iterator and view constructors out of line (#1683)

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

## What do these changes do?

Moves `multidict_{items,keys,values}_iter_new()` and
`_multidict_view_new()` out of line. Each had several callers
(`tp_iter`, the proxy's `tp_iter`, view `__iter__` and `__reversed__`,
`keys()`/`items()`/`values()`, `__reduce__`), and every one carried its
own copy of the constructor body. The callers become tail calls into one
shared copy.

The C extension's `.text` shrinks by 640 bytes on GIL and 1184 bytes on
FT. Creating an iterator costs 8 to 12 more instructions and creating a
view 2 to 3 more; stepping an iterator is unchanged. Allocation
dominates the cost of these calls, and pyperf cannot tell the two builds
apart.

Pure Python has no equivalent; this only changes code layout in the C
extension.

## Are there changes in behavior for the user?

No.

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

No.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [ ] Unit tests for the changes exist (N/A, no behavior change; the
existing suite covers these paths)
- [x] Documentation reflects the changes (N/A)
- [ ] If you provide code modification, please add yourself to
`CONTRIBUTORS.txt` (N/A)
- [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`

Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.

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

Callgrind, `benchmarks/callgrind_driver.py --include-multidict-only`,
3.14.7 and 3.14.7t, `PYTHONHASHSEED=0`. Extra ad-hoc rows were added to
a scratch copy of the registry for the constructors it does not cover. A
base-to-base control run was exactly 0 on every row. Ir per op, delta vs
master:

| op | GIL | FT |
| --- | --- | --- |
| `iter(d)` | 500 → +8 (+1.6%) | 784 → +8 (+1.0%)... (continued)

793 of 1586 branches covered (50.0%)

Branch coverage included in aggregate %.

9352 of 10217 relevant lines covered (91.53%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37330081021.1 05 Oct 2026 03:07PM UTC 98
85.95
GitHub Action Run
Source Files on build 37330081021
  • Tree
  • List 49
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37330081021
  • a6a0a4bc on github
  • Prev Build on master (#37242532505)
  • Next Build on master (#37421172665)
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