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

aio-libs / multidict / 36223626911
87%

Build:
DEFAULT BRANCH: master
Ran 26 Sep 2026 06:24AM UTC
Jobs 1
Files 43
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

25 Sep 2026 08:47PM UTC coverage: 87.068% (-0.02%) from 87.089%
36223626911

push

github

web-flow
Forbid instantiating views and iterators with Py_TPFLAGS_DISALLOW_INSTANTIATION (#1595)

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

## What do these changes do?

The C view types (`_ItemsView`, `_KeysView`, `_ValuesView`) and the
three iterator types blocked direct instantiation with hand-written
`tp_new` slots that just raised `TypeError`. CPython has provided
`Py_TPFLAGS_DISALLOW_INSTANTIATION` for exactly this since 3.10, the
project minimum, so the slots and their helpers are replaced by the
flag. The dead `PY_VERSION_HEX >= 3.10` guards around
`Py_TPFLAGS_IMMUTABLETYPE` in the same specs are dropped too.

The types were already final (no `Py_TPFLAGS_BASETYPE`); a new test
locks that in. The pure-Python backend has no equivalent types, so it is
unaffected.

## Are there changes in behavior for the user?

Only the error text: `cannot create '..._KeysView' instances directly`
became CPython's `cannot create '..._KeysView' instances`. On 3.10,
`T.__new__(T)` is refused by `object.__new__`'s safety check with
`object.__new__(T) is not safe` instead.

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

No, it removes code.

## Related issue number

Follow-up to #1163 and #1377.

## Checklist

- [x] I think the code is well written
- [x] Unit tests for the changes exist
- [x] Documentation reflects the changes (N/A, private types)
- [ ] 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>

Tests, rebased on 27fec2d:
- C extension, CPython 3.10.17: 2771 passed, 170 skipped
- C extension, CPython 3.14.7t: 2758 passed, 183 skipped
- Pure Python (`MULTIDICT_NO_EXTENSIONS=1 --no-c-extensions`), 3.10.17,
clean tree cop... (continued)

780 of 1560 branches covered (50.0%)

Branch coverage included in aggregate %.

12 of 15 new or added lines in 1 file covered. (80.0%)

4 existing lines in 1 file now uncovered.

8168 of 8717 relevant lines covered (93.7%)

1.87 hits per line

Uncovered Changes

Lines Coverage ∆ File
3
93.4
-0.11% tests/test_multidict.py

Coverage Regressions

Lines Coverage ∆ File
4
93.4
-0.11% tests/test_multidict.py
Jobs
ID Job ID Ran Files Coverage
1 MyPy - 36223626911.1 26 Sep 2026 06:24AM UTC 86
87.07
GitHub Action Run
Source Files on build 36223626911
  • Tree
  • List 43
  • 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 #36223626911
  • 91d53299 on github
  • Prev Build on master (#36185656249)
  • Next Build on master (#36228042210)
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