ruff
ruff copied to clipboard
Implement `flake8-self`
- [ ]
SLF001: Private member access
Detects accessing a private attribute, e.g. obj._private, but allows for self._private, cls._private, and mcs._private (for in metaclasses). It doesn't currently check that cls._private is only within a class method, etc., which is something that could be improved. It also always allows access to dunders, e.g. obj.__eq__.
I would like to differentiate the rule between _private and __private/_Class__private members. Maybe SLF001 and SLF002.