{"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.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install slotscheck"],"cli":null},"imports":["from slotscheck import slotscheck"],"auth":{"required":false,"env_vars":[]},"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}