{{ message }}
Repository navigation
[PR #6547/65de218c backport][3.15] Remove overlapping slots and fix broken slots inheritance - #13716
Merged
webknjaz merged 4 commits intoSep 15, 2026
Merged
Conversation
) * Remove overlapping slots, fix broken slots inheritance * added "CHANGES" entry * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fix refs in CHANGES * added name to contributors * extra clarification on CookieMixin __slots__ ignore * add slotscheck to github CI workflow * use "python -m" in slotscheck run to ensure aiohttp.worker module can be imported * install base requirements for slotscheck in CI Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> (cherry picked from commit 65de218)
RouteDef and StaticDef are attrs classes with slots=True, but their slotless abc base still gave every instance a __dict__. slotscheck rejects this, which failed the Lint job on the aio-libs#6547 backport.
Merging this PR will not alter performance
Comparing Footnotes
|
webknjaz
marked this pull request as ready for review
September 15, 2026 11:06
Confidence Score: 4/5Merge is blocked by an explicit repository requirement for changelog fragment names. The final review contains one blocking repository-rule finding and no security findings. Files Needing Attention: CHANGES/6547.bugfix Reviews (1): Last reviewed commit: "Add change note for AbstractRouteDef slo..." | Re-trigger Greptile |
This was referenced Sep 15, 2026
webknjaz
approved these changes
Sep 15, 2026
Contributor
4 of 5 tasks
webknjaz
pushed a commit
that referenced
this pull request
Sep 15, 2026
…] Remove overlapping slots and fix broken slots inheritance (#13726) Co-authored-by: aio-libs bot <aiolibsbot@koston.org> Co-authored-by: Arie Bovenberg <a.c.bovenberg@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

This is a (manual) backport of PR #6547 as merged into master (65de218).
Supersedes #13466: same cherry-pick by @webknjaz, rebased onto current
3.15, plus the fixLint / sdistneeded there.What do these changes do?
The #6547 backport turns on
slotscheck -v -m aiohttpin the sdist lint job. On3.15it failed with:Master never hit this because
RouteDefandStaticDefare plain dataclasses there. On3.15they're still@attr.s(slots=True)classes, but theirabc.ABCbase has no__slots__, so every instance still got a__dict__. This PR adds__slots__ = ()toAbstractRouteDef, which makes the slots work and satisfies slotscheck. It also changes the CI dependency install line to match master's (requirements/base.in -c requirements/base.txt) so the workflow stays the same on both branches.Are there changes in behavior for the user?
RouteDefandStaticDefinstances (fromweb.get(),web.static(),RouteTableDef, …) no longer have a__dict__. They're frozen attrs classes, so you already couldn't set attributes on them normally. Subclasses ofAbstractRouteDefthat don't declare__slots__still get a__dict__.Is it a substantial burden for the maintainers to support this?
No. It's a one-line change, and slotscheck in CI will stop it from regressing.
Related issue number
Backport of #6547; replaces #13466.
Checklist
CONTRIBUTORS.txt(original author added via the cherry-pick)CHANGES/folderLocal verification
slotscheckcouldn't be installed offline, so I used a small script that applies the same superclass/overlap rules. On unmodified3.15it reported exactly the two CI errors above. With the fix it reportedOK(298 classes).Drafted with Claude Opus 5 (Kōan); reviewed by: pending operator review.