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

aio-libs / multidict / 40123015404
86%

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

24 Oct 2026 06:56PM UTC coverage: 85.873% (+0.002%) from 85.871%
40123015404

push

github

web-flow
Let proxy subclasses convert their argument in __init__() (#1825)

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

## What do these changes do?

Since #1782, `MultiDictProxy.__new__()` and `CIMultiDictProxy.__new__()`
validated the proxied multidict, so a subclass that converts its raw
argument in its own `__init__()` (Litestar's `Headers` does
`super().__init__(CIMultiDict(headers))`) raised `TypeError` before that
`__init__()` ran.

For a subclass that overrides `__init__()`, `__new__()` now uses its
argument only when it is a valid target and otherwise installs an empty
multidict of the matching class, which the subclass's `__init__()`
replaces. The proxy never forwards to a NULL multidict, so the crash
#1782 fixed stays fixed, and `Sub(d)` with a no-op `__init__()` still
proxies `d`. Classes that do not override `__init__()` behave as before.
Both backends are changed the same way.

## Are there changes in behavior for the user?

Yes; proxy subclasses that convert their argument in `__init__()` work
again, as in 7.1.0.

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

No; the change is confined to the cold `__new__()` path of subclasses.

## Related issue number

Fixes #1824

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes
- [ ] 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>

Tests: C extension on 3.11.13 (4290 passed), 3.14.7 (4286 passed),
3.14.7t (4271 passed); pure Python on 3.11.13 with
`MULTIDICT_NO_EXTENSIONS=1 --no-c-extensions` (1705 passed). The
reproducer from the issue prints `{'Content-Type': 'text/plain'}` on
both backends.
Lint: pre-commit on the changed files passed; `make... (continued)

847 of 1694 branches covered (50.0%)

Branch coverage included in aggregate %.

43 of 44 new or added lines in 3 files covered. (97.73%)

1 existing line in 1 file now uncovered.

9839 of 10750 relevant lines covered (91.53%)

1.83 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
71.41
-0.04% multidict/_multidict_py.py

Coverage Regressions

Lines Coverage ∆ File
1
73.86
-0.1% tests/test_capi.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 40123015404.1 24 Oct 2026 06:57PM UTC 100
85.87
GitHub Action Run
Source Files on build 40123015404
  • Tree
  • List 50
  • Changed 4
  • Source Changed 3
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40123015404
  • 6526b960 on github
  • Prev Build on v7.2.0 (#40075347346)
  • Next Build on master (#40124174530)
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