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

aio-libs / multidict / 37732114291
86%

Build:
DEFAULT BRANCH: master
Ran 08 Oct 2026 05:24AM 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

08 Oct 2026 05:23AM UTC coverage: 85.962% (+0.001%) from 85.961%
37732114291

push

github

web-flow
Rewrite md_update_from_ht() on top of md_walk_all() (#1744)

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

## What do these changes do?

Rewrites `md_update_from_ht()` in `bulk_update.h` on top of
`md_walk_all()`, as #1742 did for `md_repr()`. The same-class and the
cross-class loops become one visitor; keys arrive materialized as the
source's, so the cross-class path no longer rebuilds the source's istr
or re-reads the source's table by hand. `md_extend_self()` keeps its own
loop, since it grows the multidict it walks.

The pure-Python backend's cross-class loop in `_parse_args()` now checks
the source's version the same way, so both backends behave identically.

The shared walk costs the same-class path: on a 100-item source,
`update()` is 10-12% slower on GIL and 16-17% on FT, `extend()` up to
20% on GIL and 34% on FT, and `merge()` 15% on GIL and 25% on FT. The
cross-class paths are within noise or faster (`MultiDict(cimultidict)`
9-12% faster). Numbers are in the footer.

## Are there changes in behavior for the user?

Yes. A str subclass key whose `lower()` mutates the source multidict
during `update()`, `extend()`, `merge()` or the constructor now raises
`RuntimeError`, as iteration does, instead of being tolerated. A `dict`
source still tolerates it.

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

No; about 50 fewer lines of C, with the mutation handling left to the
shared walk.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [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`

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

Tests: `pytest -q` on 3.14.7 (4087 passed) and 3.14.7t (4072 pas... (continued)

793 of 1586 branches covered (50.0%)

Branch coverage included in aggregate %.

22 of 23 new or added lines in 2 files covered. (95.65%)

9360 of 10225 relevant lines covered (91.54%)

1.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
94.9
-0.08% tests/test_mutable_multidict.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37732114291.1 08 Oct 2026 05:24AM UTC 98
85.96
GitHub Action Run
Source Files on build 37732114291
  • Tree
  • List 49
  • 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 #37732114291
  • c9e9a230 on github
  • Prev Build on master (#37731490339)
  • Next Build on master (#37733835205)
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