Registry / testing / slotscheck

slotscheck

JSON →
library0.20.0pypypi✓ verified 88d ago

Slotscheck is a Python library that helps ensure your `__slots__` are working properly. It acts as a linter, identifying classes where `__slots__` might not be effective or are misused, thereby aiding in memory optimization and performance. The current version is 0.19.1, and it has a regular release cadence, often aligning with new Python versions.

pip install slotscheck
INSTALL
IMPORT
SIG · SLOTSCHECK
S
slotscheck
testingpythonv0.20.0
Install
1.6s avg
Import
—
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.20.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.8MB
glibc
py 3.10–3.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

slotscheck
✓ import slotscheck
✗ from slotscheck import slotscheck

This quickstart demonstrates how to import and use the `slotscheck` function to verify `__slots__` implementation for individual classes. It shows examples of both a correctly slotted and an unslotted class, and how to get results from the checker. It can also be used to check entire modules.

from slotscheck import slotscheck class MySlottedClass: __slots__ = ('x', 'y') def __init__(self, x, y): self.x = x self.y = y class MyUnslottedClass: def __init__(self, x, y): self.x = x self.y = y results_slotted = slotscheck(MySlottedClass) print(f"MySlottedClass check results: {results_slotted}") results_unslotted = slotscheck(MyUnslottedClass) print(f"MyUnslottedClass check results: {results_unslotted}") # To check an entire module (e.g., the current file): # import sys # current_module = sys.modules[__name__] # module_results = slotscheck(current_module) # print(f"Current module check results: {module_results}")
Debug
Known issues
breakingPython 3.8 support was dropped in `slotscheck` version `0.19.1`. If you are using Python 3.8, you must upgrade your Python interpreter or pin your `slotscheck` version.
fix
Upgrade your Python environment to 3.9 or newer, or pin `slotscheck==0.18.0` in your project's dependencies.
affects: >=0.19.1
breakingPython 3.7 support was dropped in `slotscheck` version `0.17.0`. Users on Python 3.7 will not be able to install or use newer versions.
fix
Upgrade your Python environment to 3.8 or newer, or pin `slotscheck < 0.17.0` in your project's dependencies.
affects: >=0.17.0
gotchaWhen using Python 3.12+, `Generic` classes could be incorrectly flagged as not having slots in `slotscheck` versions prior to `0.17.1`, leading to false positives.
fix
Upgrade to `slotscheck >= 0.17.1` to resolve the false positive for `Generic` classes.
affects: 0.17.0 (on Python 3.12+)
gotcha`TypedDict` imported from `typing_extensions` could be incorrectly flagged as not having slots in `slotscheck` versions prior to `0.16.5`, particularly in Python versions where `TypedDict` is already in the standard library.
fix
Upgrade to `slotscheck >= 0.16.5` to correctly handle `TypedDict` instances.
affects: <0.16.5
Upgrade
Version history
0.20.0latest on PyPI · released May 29, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
26 hits · last 30 days
node
24
Resources
slotscheck — pip install slotscheck · libregistry