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

aio-libs / multidict / 38159918890
86%

Build:
DEFAULT BRANCH: master
Ran 11 Oct 2026 05:31PM UTC
Jobs 1
Files 50
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

11 Oct 2026 05:30PM UTC coverage: 86.054%. Remained the same
38159918890

push

github

web-flow
Borrow the key's identity in add, setitem, delitem and getall (#1769)

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

## What do these changes do?

`md[key]` borrows the identity of an exact `str` key (or of an exact
`istr`'s canonical form) and computes an owned one only for other keys.
`add()`, `md[key] = value`, `del md[key]` and `getall()` still computed
an owned identity on every call, paying an incref and a decref. They now
borrow it the same way, with a separate fallback for the other keys.
`md_calc_identity_hash_fits()` lost its last caller and is removed.

The caller's reference to the key keeps a borrowed identity alive across
the finalizers a delete or replace can run;
`tests/test_finalizer_reentrancy.py` already covers those paths for both
classes. The pure-Python backend has no equivalent cost and is
unchanged.

## Are there changes in behavior for the user?

No.

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

No, it repeats the pattern `md_get_one()` already uses.

## Related issue number

N/A

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist (existing tests; no behaviour
change)
- [x] Documentation reflects the changes (N/A, no API change)
- [ ] 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>

Instructions per operation, `benchmarks/callgrind_driver.py
--include-multidict-only`, CPython 3.14.7 and 3.14.7t, master 709f2600
vs this branch:

| operation | GIL MultiDict | GIL CIMultiDict | FT MultiDict | FT
CIMultiDict |
|---|---|---|---|---|
| delitem | 265.5 → 247.5 (-6.8%) | 315.9 → 293.9 (-7.0%) | +1.1% |
+2.6% |
| setitem_replace | 323.3 → 314.3 (-2.8%) | 363.5 → 352.5 (-3.0%) |
-2.7% | -2.9% |
| setitem_insert | ... (continued)

832 of 1664 branches covered (50.0%)

Branch coverage included in aggregate %.

9757 of 10641 relevant lines covered (91.69%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 38159918890.1 11 Oct 2026 05:31PM UTC 100
86.05
GitHub Action Run
Source Files on build 38159918890
  • Tree
  • List 50
  • 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 #38159918890
  • bbdea60b on github
  • Prev Build on master (#38127370395)
  • Next Build on master (#38161442554)
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