---
source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs
---
SIM210 [*] Use `bool(...)` instead of `True if ... else False`
 --> SIM210.py:1:5
  |
1 | a = True if b else False  # SIM210
  |     ^^^^^^^^^^^^^^^^^^^^
2 |
3 | a = True if b != c else False  # SIM210
  |
help: Replace with `bool(...)
  |
  - a = True if b else False  # SIM210
1 + a = bool(b)  # SIM210
2 |
  |
note: This is an unsafe fix and may change runtime behavior

SIM210 [*] Remove unnecessary `True if ... else False`
 --> SIM210.py:3:5
  |
1 | a = True if b else False  # SIM210
2 |
3 | a = True if b != c else False  # SIM210
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^
4 |
5 | a = True if b + c else False  # SIM210
  |
help: Remove unnecessary `True if ... else False`
  |
2 |
  - a = True if b != c else False  # SIM210
3 + a = b != c  # SIM210
4 |
  |
note: This is an unsafe fix and may change runtime behavior

SIM210 [*] Use `bool(...)` instead of `True if ... else False`
 --> SIM210.py:5:5
  |
3 | a = True if b != c else False  # SIM210
4 |
5 | a = True if b + c else False  # SIM210
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
6 |
7 | a = False if b else True  # OK
  |
help: Replace with `bool(...)
  |
4 |
  - a = True if b + c else False  # SIM210
5 + a = bool(b + c)  # SIM210
6 |
  |
note: This is an unsafe fix and may change runtime behavior

SIM210 Use `bool(...)` instead of `True if ... else False`
  --> SIM210.py:15:9
   |
13 |         return False
14 |
15 |     a = True if b else False
   |         ^^^^^^^^^^^^^^^^^^^^
   |
help: Replace with `bool(...)

SIM210 [*] Remove unnecessary `True if ... else False`
  --> SIM210.py:19:11
   |
18 |   # Regression test for: https://github.com/astral-sh/ruff/issues/7076
19 |   samesld = True if (psl.privatesuffix(urlparse(response.url).netloc) ==
   |  ___________^
20 | |                                    psl.privatesuffix(src.netloc)) else False
   | |____________________________________________________________________________^
   |
help: Remove unnecessary `True if ... else False`
   |
18 | # Regression test for: https://github.com/astral-sh/ruff/issues/7076
   - samesld = True if (psl.privatesuffix(urlparse(response.url).netloc) ==
   -                                    psl.privatesuffix(src.netloc)) else False
19 + samesld = (psl.privatesuffix(urlparse(response.url).netloc) ==
20 +                                    psl.privatesuffix(src.netloc))
   |
note: This is an unsafe fix and may change runtime behavior
