ruff icon indicating copy to clipboard operation
ruff copied to clipboard

Implement `flake8-self`

Open ngnpope opened this issue 2 years ago • 1 comments

GitHub, PyPI.

  • [ ] 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__.

ngnpope avatar Jan 31 '23 20:01 ngnpope

I would like to differentiate the rule between _private and __private/_Class__private members. Maybe SLF001 and SLF002.

spaceone avatar Jan 31 '23 20:01 spaceone