Closed Skylion007 closed 1 year ago
Thanks for the advice. I'm going to investigate enabling more flake8 plugins.
@XuehaiPan FYI, ruff has a pretty good list of plugins (and automated fixes for some): https://beta.ruff.rs/docs/rules/
@Skylion007 I opened a new PR #34 to resolve this.
Required prerequisites
Motivation
Since this project is speed motivated, it would best best use flake8-comprehensions to ensure that any list/dict/tuple etc comprehensions. Skimming over the list, of checks it looks like most if not all the best practices are already implemented in this repo, best just to add it though to ensure that future sub-optimal codepaths are not accidentally introduced.
We recently enabled almost all the checks in the latest version of PyTorch.
Solution
Add flake8-comprehensions plugin
Alternatives
Do not add it, rely on code review to maintain performance and avoid useless or wasteful comprehensions, builtin calls, etc.
Additional context
We enabled all the checks in PyTorch anyhow.