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

aio-libs / multidict / 36350699863
87%

Build:
DEFAULT BRANCH: master
Ran 27 Sep 2026 09:11PM UTC
Jobs 1
Files 45
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

27 Sep 2026 09:10PM UTC coverage: 87.272% (+0.01%) from 87.258%
36350699863

push

github

web-flow
Reserve room for bulk adds by free room, not table size (#1617)

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

## What do these changes do?

Before a bulk `extend()`, `update()` or `merge()`, the C extension
reserved room by comparing the estimated table size for `used + extra`
with the current size. That ignores the room deleted entries hold, so a
table short of room only because of deletions skipped the reservation
and the adds grew it to three times the live entries mid-call. The
reservation now checks the free room (`usable >= extra`) and otherwise
rebuilds at the size estimated from live entries, which compacts such a
table and can shrink it. This also makes the reservation an actual
guarantee that the adds which follow do not resize.

The pure-Python `update()` and `merge()` used the same size comparison,
and `extend()` resized unconditionally, even when the table already had
room. All three go through one `_reserve()` with the C rule. Its cap at
17 in `update()` and `merge()` is dropped: C never had it, the
pure-Python size is always a real `len()`, and a capped rebuild could
pick a table too small for the live entries.

## Are there changes in behavior for the user?

Bulk adds into a table with many deleted entries compact it instead of
growing it, on both backends.

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

No; both backends now share one rule, and the pure-Python code loses two
branches.

## 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
- [ ] 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 Opus 5.5 (Claude Code); reviewed by @asvetlov.

<details>
<summary>Agent run details (optional, for revi... (continued)

779 of 1558 branches covered (50.0%)

Branch coverage included in aggregate %.

23 of 24 new or added lines in 2 files covered. (95.83%)

8471 of 9041 relevant lines covered (93.7%)

1.87 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
97.01
-0.07% tests/test_mutable_multidict.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36350699863.1 27 Sep 2026 09:11PM UTC 90
87.27
GitHub Action Run
Source Files on build 36350699863
  • Tree
  • List 45
  • Changed 3
  • Source Changed 2
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #36350699863
  • 512f00a4 on github
  • Prev Build on master (#36348057864)
  • Next Build on master (#36383563382)
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