Broken `__slots__` are a silent performance killer—Let's fix them!
- Track:
- Testing, Quality Assurance, Security
- Type:
- Talk
- Level:
- advanced
- Duration:
- 30 minutes
Abstract
Using __slots__
on Python classes aims to boost performance, but it can backfire if misconfigured—a common and silent issue often caused by inheritance subtleties. Learn from real-world cases where these problems were found and fixed in major libraries (even the stdlib), undermining intended memory/speed gains.
This talk presents slotscheck
, a tool enabling automated testing of __slots__
correctness within your CI/CD pipeline. Learn how to implement effective checks, apply lessons from real-world debugging and fixing, and ensure your use of __slots__
contributes positively to code quality and efficiency. Leave ready to diagnose and fix these silent bugs in your own projects.