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

aio-libs / multidict / 38161442554
86%

Build:
DEFAULT BRANCH: master
Ran 11 Oct 2026 05:53PM 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:52PM UTC coverage: 86.054%. Remained the same
38161442554

push

github

web-flow
Check a CIMultiDict key for a borrowed identity only once (#1770)

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

## What do these changes do?

CodSpeed on #1769 flagged `test_cimultidict_add_str_mixed_case[c]` 9%
slower. A key that cannot lend its identity, such as a `CIMultiDict`
`str` key holding uppercase letters, first went through the failed
borrow attempt and then through `md_calc_identity_hash()`, which
repeated the istr, ASCII and uppercase tests; with more callers that
helper also fell out of line.

`md_identity_or_new()` runs each test once and returns either the
borrowed identity or a new reference, and `md_identity_is_new()` tells
the two apart without an ownership flag or an out-pointer. Each of
`add()`, `md[key] = value`, `del md[key]` and `getall()` now calls its
body once. The #1769 news fragment is updated to the resulting numbers.
The pure-Python backend is unchanged.

## Are there changes in behavior for the user?

No.

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

No, it replaces the per-operation `_owned` helpers #1769 added with one
identity helper.

## Related issue number

Follow-up to #1769.

## 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>

Mixed-case `CIMultiDict` keys, Ir per call on GIL 3.14.7 (callgrind,
includes the lowering), before #1769 / with #1769 / this PR:

| op | before #1769 | #1769 | this PR |
|---|---|---|---|
| add | 1891 | 1966 | 1907 |
| `md[k] = v` | 1881 | 1935 | 1879 |
| `del md[k]` | 1614 | 1664 | 1606 |
| getall | 2137 | 2194 |... (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 - 38161442554.1 11 Oct 2026 05:53PM UTC 100
86.05
GitHub Action Run
Source Files on build 38161442554
  • 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 #38161442554
  • 64a6b716 on github
  • Prev Build on master (#38159918890)
  • Next Build on master (#38169984703)
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