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

aio-libs / multidict / 37145249750
86%

Build:
DEFAULT BRANCH: master
Ran 03 Oct 2026 06:44PM 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

03 Oct 2026 06:43PM UTC coverage: 85.966%. Remained the same
37145249750

push

github

web-flow
Release dead references with Py_DECREF or Py_XDECREF (#1657)

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

## What do these changes do?

Replaces `Py_CLEAR()` on the C extension's success paths with
`Py_DECREF()`
or `Py_XDECREF()` wherever nothing reads the variable afterwards.
`Py_DECREF()` is used where the reference is known to be non-NULL, and
`Py_XDECREF()` where it can be NULL. Error paths, where an exception is
set, keep `Py_CLEAR()`. So do loops whose `fail:` label releases the
variable again, type `tp_clear` slots and module state.

`multidict_tp_richcompare()` also releases the `keys()` result inside
the
branch where it is known to exist.

## Are there changes in behavior for the user?

No. Comparing a multidict with another mapping got up to 4% faster.
Building
or re-initializing one from items got 1-1.7% faster.

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

No, it only changes reference counting in the C extension. The
pure-Python
backend has no equivalent.

## Related issue number

Fixes #1642

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist (existing tests cover the changed
paths; no new behaviour)
- [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`

Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.

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

Callgrind, per-op Ir, `PYTHONHASHSEED=0`, 20/60 rounds minus a noop arm,
CPython 3.14.7 and 3.14.7t, base `dd3227e5`.

`benchmarks/callgrind_driver.py --include-multidict-only`, rows moved by
0.05%
or more:

| op | GIL | FT |
| --- | --- | --- |
| `ctor_items` MultiDict | -1.74% | -1.07% |
| `ctor_items` CIMultiDict | -1.17% | -0.84% |
| `ctor_small`... (continued)

791 of 1582 branches covered (50.0%)

Branch coverage included in aggregate %.

9224 of 10068 relevant lines covered (91.62%)

1.83 hits per line

Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37145249750.1 03 Oct 2026 06:44PM UTC 98
85.96
GitHub Action Run
Source Files on build 37145249750
  • Tree
  • List 49
  • 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 #37145249750
  • 78e4852f on github
  • Prev Build on master (#37144706353)
  • Next Build on master (#37146282000)
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