Open xqt opened 2 years ago
There's similar removing case to bool problems with some of the other rules, see my comment on https://github.com/MartinThoma/flake8-simplify/issues/3
Just a short heads up: I'm recently spending most of my free time on PyPDF2. I do see those issues, but it might be a while until I work on them.
PRs have a better chance to get merged soon.
Desired change
Use 'True' instead of '... or True'
is wrongExample
'foo' or True
gives'foo'
but notTrue
,1 or True
gives1
but notTrue
.'0' or True
gives'0'
but notTrue
whereas'' or True
givesTrue
0 or True
givesTrue
In general:
x or True
can be calculated asx if bool(x) else True