Closed robmcd closed 1 year ago
Sadly, this cannot be fixed in flake8-simplify with reasonable effort. At this point, flake8-simplify thinks it's a dictionary because it sees the "keys()" method being used. There is no type information. You can disable the rule globally or on that line.
If you have control over DynamicFrameCollection, you might also want to implement __contains__
in a way that behaves like Python dictionaries.
With code like:
Where dfc is an instance of DynamicFrameCollection
We see:
However, the suggested change will produce a
KeyError
.Is there some way to fix the recommendation to avoid these false positives (apart from ignoring the rule/line)?