Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement flake8-self #2411

Closed
1 task
ngnpope opened this issue Jan 31, 2023 · 1 comment · Fixed by #2470
Closed
1 task

Implement flake8-self #2411

ngnpope opened this issue Jan 31, 2023 · 1 comment · Fixed by #2470
Labels
plugin Implementing a known but unsupported plugin

Comments

@ngnpope
Copy link
Contributor

ngnpope commented Jan 31, 2023

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__.

@spaceone
Copy link
Contributor

spaceone commented Jan 31, 2023

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

@charliermarsh charliermarsh added the plugin Implementing a known but unsupported plugin label Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin Implementing a known but unsupported plugin
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants