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

aio-libs / multidict / 37198908438
86%

Build:
DEFAULT BRANCH: master
Ran 04 Oct 2026 11:30AM 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

04 Oct 2026 11:29AM UTC coverage: 86.01% (-0.02%) from 86.028%
37198908438

push

github

web-flow
Keep the items when a multidict is re-initialized from itself with kwargs (#1666)

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

## What do these changes do?

`d.__init__(d, key=value)` and `d.__init__(proxy_of_d, key=value)`
emptied `d` on the C extension and left only the keyword arguments. With
keyword arguments the clone fast path is skipped, so
`_multidict_tp_init()` called `md_init()`, which replaced the table, and
then copied "from itself" out of the now empty table. The fix keeps the
table in that case and only reserves room for the keyword arguments
before adding them.

The pure-Python implementation snapshots its own items first and was
already correct, so it is unchanged; the new test runs on both backends.

## Are there changes in behavior for the user?

Yes, on the C extension only: re-initializing a multidict from itself
with keyword arguments keeps the existing items, as the pure-Python
implementation does.

## 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
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes (N/A, no documented behaviour
changed)
- [ ] 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 Fable 5.1); not yet reviewed by a
human.

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

The new test failed on the C extension before the fix (4 of 8 cases) and
passes after it.

- C extension, 3.14.7: `pytest tests -q --no-cov`, 4075 passed, 179
skipped
- C extension, 3.10.17: 4079 passed, 175 skipped
- C extension, 3.14.7t: 4060 passed, 194 skipped
- Pure Python, 3.14.7, clean tree: `MULTIDICT_NO_EXTENSIONS=1 pytest
tests -q --no-cov --no-c-extensions`, 1604 p... (continued)

792 of 1584 branches covered (50.0%)

Branch coverage included in aggregate %.

15 of 20 new or added lines in 2 files covered. (75.0%)

9315 of 10167 relevant lines covered (91.62%)

1.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
74.02
-0.09% tests/test_capi.py
1
93.65
-0.02% tests/test_multidict.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37198908438.1 04 Oct 2026 11:30AM UTC 98
86.01
GitHub Action Run
Source Files on build 37198908438
  • Tree
  • List 49
  • Changed 4
  • Source Changed 2
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37198908438
  • 644de739 on github
  • Prev Build on master (#37198783884)
  • Next Build on master (#37199292436)
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