Projects: enable flake8-bugbear warnings
Enable the additional flake8-bugbear warnings. See https://github.com/PyCQA/flake8-bugbear for the list of warnings and the list of athena MRs for typical fixes that were required (of which there were some real bugs).
The following are (for the moment) being ignored:
-
B006: Do not use mutable data structures for argument defaults, e.g.
def foo(input=[])
- In principle a good idea but will require a huge number of fixes.
-
B007: Loop control variable not used within the loop body.
- Harmless warning and code like
for name,value in mydict.items()
could be considered more readable thanfor _,value in mydict.items()
even ifname
is unused.
- Harmless warning and code like
-
B019: Use of
functools.lru_cache
orfunctools.cache
on methods can lead to memory leaks.- Indeed, trade-off between memory and speed but we use it for the latter in many places.
Thanks to @maszyman for pointing out this useful plugin.
Requires: !71255 (merged)
Edited by Frank Winklmeier