Closed akx closed 2 years ago
The pattern
if a: token = a[1] elif 'token' in dct: token = dct['token'] else: token = None
is reported as
SIM401 Use 'token = dct.get(token, "None")' instead of an if-block
though it obviously should be
SIM401 Use 'token = dct.get(token, None)' instead of an if-block
or when the default is None,
SIM401 Use 'token = dct.get(token)' instead of an if-block
See above.
hi @akx , Thank you for reporting this issue. I'm currently fixing several issues with SIM401 in PR #85 . This
Closed by https://github.com/MartinThoma/flake8-simplify/pull/85
Thank you very much for your help. The issue was fixed in flake8-simplify==0.14.6
flake8-simplify==0.14.6
Desired change
Explanation
The pattern
is reported as
though it obviously should be
or when the default is None,
Example
See above.