MartinThoma / flake8-simplify

❄ A flake8 plugin that helps you to simplify code
MIT License
186 stars 19 forks source link

SIM210/SIM211: Ternary operator #2

Closed MartinThoma closed 4 years ago

MartinThoma commented 4 years ago

Rule

Use the condition directly (or bool(condition)) to get a boolean. Do not use the ternary operator.

Example

# Bad
True if condition else False

# Good
condition