[`pylint`] Implement `class-variable-slots-conflict` (`PLE0242`)
Summary
Add the pylint rule class-variable-slots-conflict.
Test Plan
New test fixtures added
Part of #970
This case:
items = ["a"] # TODO
class NotOk:
__slots__ = items
a = None
pylint does catch, is this something we can handle by using the deferred scopes?
ruff-ecosystem results
Linter (stable)
✅ ecosystem check detected no linter changes.
Linter (preview)
✅ ecosystem check detected no linter changes.
Thank's for implementing the new rule. I'm trying to understand the rule, but I couldn't find any useful explanation. Would you mind outlining why this specific pattern is bad or linking to some resources? The wording doesn't need to be final, but it would help me understand and triage the rule.
Hi Michael, thanks for taking a look, yes of course sorry about that. I'll add it when I next get some time.
Thank's for implementing the new rule. I'm trying to understand the rule, but I couldn't find any useful explanation. Would you mind outlining why this specific pattern is bad or linking to some resources? The wording doesn't need to be final, but it would help me understand and triage the rule.
Not that this excuses me missing it out in the docstring but I did link to this page here. I have since found a page which explains the feature more fully so I'll link that and add a summary at the top level.
This case:
items = ["a"] # TODO class NotOk: __slots__ = items a = Nonepylint does catch, is this something we can handle by using the deferred scopes?
I realised that this could well be handled by performing the lint at the module level instead, would this be sensible?