{"id":10231,"library":"slotscheck","title":"Slotscheck","description":"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.","status":"active","version":"0.19.1","language":"python","source_language":"en","source_url":"https://github.com/ariebovenberg/slotscheck","tags":["slots","linting","performance","memory","optimization","dataclasses","typing"],"install":[{"cmd":"pip install slotscheck","lang":"bash","label":"Install stable version"}],"dependencies":[],"imports":[{"wrong":"from slotscheck import slotscheck","symbol":"slotscheck","correct":"import slotscheck"}],"quickstart":{"code":"from slotscheck import slotscheck\n\nclass MySlottedClass:\n    __slots__ = ('x', 'y')\n\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\nclass MyUnslottedClass:\n    def __init__(self, x, y):\n        self.x = x\n        self.y = y\n\nresults_slotted = slotscheck(MySlottedClass)\nprint(f\"MySlottedClass check results: {results_slotted}\")\n\nresults_unslotted = slotscheck(MyUnslottedClass)\nprint(f\"MyUnslottedClass check results: {results_unslotted}\")\n\n# To check an entire module (e.g., the current file):\n# import sys\n# current_module = sys.modules[__name__]\n# module_results = slotscheck(current_module)\n# print(f\"Current module check results: {module_results}\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer, or pin `slotscheck==0.18.0` in your project's dependencies.","message":"Python 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.","severity":"breaking","affected_versions":">=0.19.1"},{"fix":"Upgrade your Python environment to 3.8 or newer, or pin `slotscheck < 0.17.0` in your project's dependencies.","message":"Python 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.","severity":"breaking","affected_versions":">=0.17.0"},{"fix":"Upgrade to `slotscheck >= 0.17.1` to resolve the false positive for `Generic` classes.","message":"When 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.","severity":"gotcha","affected_versions":"0.17.0 (on Python 3.12+)"},{"fix":"Upgrade to `slotscheck >= 0.16.5` to correctly handle `TypedDict` instances.","message":"`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.","severity":"gotcha","affected_versions":"<0.16.5"}],"env_vars":null,"search_vec":"'0.19.1':42 'act':16 'aid':32 'align':51 'cadenc':49 'class':21 'current':39 'dataclass':61 'effect':27 'ensur':9 'help':8 'identifi':20 'librari':6 'lint':57 'linter':19 'memori':34,59 'might':24 'misus':30 'new':53 'often':50 'optim':35,60 'perform':37,58 'proper':14 'python':5,54 'regular':47 'releas':48 'slot':11,23,56 'slotscheck':1,2 'therebi':31 'type':62 'version':40,55 'work':13","created_at":"2026-04-17T01:23:03.017145+00:00","updated_at":"2026-04-17T01:23:03.017145+00:00","problems":null,"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.20.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/ariebovenberg/slotscheck","docs":null,"changelog":null,"pypi":"https://pypi.org/project/slotscheck/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-30","last_verified":"2026-06-30","next_check":"2026-07-30","install_tag":null}}