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

aio-libs / multidict / 37224964410
86%

Build:
DEFAULT BRANCH: master
Ran 04 Oct 2026 06:35PM 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 06:34PM UTC coverage: 85.94% (-0.02%) from 85.962%
37224964410

push

github

web-flow
Merge the bodies of pop() and popone(), and the proxy argument checks (#1677)

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

## What do these changes do?

Removes three repetitions from the C extension:

- `pop()` and `popone()` had identical bodies apart from the name passed
to the argument parser; they share one now.
- The "return the default or raise `KeyError`" tail was written out in
`getone()`, `getall()`, `pop()`, `popone()` and `popall()`; it is one
helper.
- The check that a proxy's argument is a multidict or a proxy of the
right class, and the lookup of the multidict behind it, existed in both
proxy `__init__()` slots, the proxy vectorcall and the two C API
constructors. It is one helper, `multidict_proxy_target()`, and each
caller keeps its own error message. The constructor paths of `MultiDict`
use the existing `_multidict_resolve_other()` instead of their own copy.

The pure-Python implementation is not affected.

## Are there changes in behavior for the user?

One error message. `CIMultiDictProxy.__init__()` called without an
argument on an existing proxy raised `TypeError` with the text of
`PyArg_UnpackTuple()` ("expected 1 argument, got 0"); it now raises the
same "`__init__() missing 1 required positional argument: 'arg'`" as
`MultiDictProxy` and the pure-Python implementation. A test covers both
classes on both backends.

Speed, instructions per operation under callgrind
(`benchmarks/callgrind_driver.py --include-multidict-only`, 3.14.7 and
3.14.7t): creating a proxy became 7% to 9% cheaper (62 to 70
instructions), since the type checks ran twice before. `pop`, `popitem`,
`getall` and the lookups are unchanged on GIL builds; on 3.14t `getall`
is 5 instructions cheaper and `d[key]` on `CIMultiDict` one instruction
dearer. The `.text` section is the same size within 100 bytes.

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

No; it removes about 110 lines of C.

## Related issue number

N/A

## Checklist

- [x] I think... (continued)

792 of 1584 branches covered (50.0%)

Branch coverage included in aggregate %.

6 of 10 new or added lines in 1 file covered. (60.0%)

9330 of 10194 relevant lines covered (91.52%)

1.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
50.0
0.88% tests/test_types.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 37224964410.1 04 Oct 2026 06:35PM UTC 98
85.94
GitHub Action Run
Source Files on build 37224964410
  • Tree
  • List 49
  • Changed 3
  • Source Changed 1
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #37224964410
  • 43d41577 on github
  • Prev Build on master (#37223883328)
  • Next Build on master (#37227841074)
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