slotscheck
Ensure your __slots__ are working properly.
Decision gist · record as of 2026-08-14
Yes. Slotscheck fills a real gap: static analyzers cannot catch slots mistakes that arise from runtime code generation, conditional imports, or deep inheritance trees. If you use `__slots__` for performance, this tool prevents silent failures that are hard to debug. Low install friction, active maintenance, MIT license, and no known vulnerabilities make it a safe addition to your development workflow.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires CPython 3.10+; does not work on PyPy, Jython, or IronPython.
- Will import and potentially execute all submodules of target packages.
- Low install friction with a single lightweight runtime dependency (tomli).
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution with minimal restrictions.
last release 2026-07-05 (40 days) · last repo commit 2026-08-11 · 127 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 160,502 downloads/mo, #10,659 on PyPI
Alternatives
Verify before relying
pip install slotscheck
python -m slotscheck [FILES]...
# or
slotscheck -m [MODULES]...- Whether slotscheck can be integrated into automated CI/CD pipelines beyond pre-commit hooks.
- Performance impact when scanning large codebases or packages with many modules.
What it is and what it does
Slotscheck is a runtime validator for Python's `__slots__` mechanism, which developers use to optimize class memory and attribute access. The tool runs your code, inspects the resulting class tree, and detects common slots mistakes that static analyzers miss: overlapping slots across inheritance hierarchies, slots defined in child classes when parents lack them, duplicate slot names, and unused slots. It works by actually importing and executing your modules, which lets it catch slots generated at import time by decorators, metaclasses, and frameworks like dataclasses, attrs, and pydantic—cases that static analysis cannot see.
You run it from the command line against files or modules, and it reports errors with class paths and problem types. It integrates into pre-commit hooks and CI pipelines to prevent slots mistakes from reaching production. The tool is CPython-specific because it relies on CPython internals to inspect the class tree; it will not work on alternative Python implementations.
Use it for
- Validate slots inheritance in a large codebase before committing to catch mistakes early via pre-commit.
- Audit a third-party library (e.g., sanic) to find slots violations in its class hierarchy.
- Enforce slots usage across a team's code to ensure consistent performance optimization practices.
- Detect unused or duplicate slots in classes that auto-generate slots via decorators or metaclasses.
- Add to CI pipeline to prevent slots regressions as code evolves and class hierarchies change.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Slotscheck fills a real gap: static analyzers cannot catch slots mistakes that arise from runtime code generation, conditional imports, or deep inheritance trees. If you use `__slots__` for performance, this tool prevents silent failures that are hard to debug. Low install friction, active maintenance, MIT license, and no known vulnerabilities make it a safe addition to your development workflow.
Install
slotscheck on PyPI
Before you install
Low install friction with a single lightweight runtime dependency (tomli). Active maintenance with recent releases and a stable repository.
Requires CPython 3.10+; does not work on PyPy, Jython, or IronPython. Will import and potentially execute all submodules of target packages.
License in practice
MIT license permits unrestricted use, modification, and distribution with minimal restrictions.
Quickstart
pip install slotscheck
python -m slotscheck [FILES]...
# or
slotscheck -m [MODULES]...
Verify before relying
- Whether slotscheck can be integrated into automated CI/CD pipelines beyond pre-commit hooks.
- Performance impact when scanning large codebases or packages with many modules.
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagetomli |
| Maintenance | Actively maintained 40 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 160,502 / month, #10,659 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Programming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: Implementation :: CPythonTopic :: Software Development :: Quality AssuranceTyping :: Typed |
Evidence: slotscheck-0.20.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “slots validation python”
- slotscheckValidates that `__slots__` are correctly implemented across class…
- django-cottonDjango Cotton adds component-based UI composition to Django…
- bleak-retry-connectorWraps Bleak's Bluetooth client with automatic retry logic and backoff…
Give your agent the search over MCP, or paste the wish link into any chat.
More Quality Assurance packages
Coverage.py measures which lines of Python code are executed during test runs, reporting coverage percentages and identifying untested code paths.
Install it if you want to measure test completeness or enforce coverage thresholds in your project.
Ruff is a Python linter and code formatter written in Rust that combines linting, formatting, and code fixing into a single tool, replacing Flake8, Black, isort, and related utilities.
Pexpect spawns and controls interactive console applications by sending input and matching output patterns, automating tasks that would otherwise require manual interaction.
Black reformats Python source code to a consistent style by parsing entire files and rewriting them according to an opinionated, deterministic set of rules, eliminating manual formatting decisions.
pytest-xdist distributes pytest tests across multiple CPU cores or machines to speed up test execution, with the simplest usage being `pytest -n auto` to spawn workers equal to available CPUs.
Install it if your test suite takes long enough that parallelization would save meaningful time.
Validates AWS CloudFormation templates in YAML or JSON format against resource provider schemas and best practices, checking property values and configuration correctness.
Install it if you work with CloudFormation templates.
See also overrides · docstring-inheritance · pyflakes · interegular · classes · pylint · recordclass · intervaltree · check-manifest · yesqa