---
source: crates/ruff_linter/src/rules/flake8_simplify/mod.rs
snapshot_kind: text
---
SIM210.py:1:5: SIM210 [*] Use `bool(...)` instead of `True if ... else False`
  |
1 | a = True if b else False  # SIM210
  |     ^^^^^^^^^^^^^^^^^^^^ SIM210
2 | 
3 | a = True if b != c else False  # SIM210
  |
  = help: Replace with `bool(...)

ℹ Unsafe fix
1   |-a = True if b else False  # SIM210
  1 |+a = bool(b)  # SIM210
2 2 | 
3 3 | a = True if b != c else False  # SIM210
4 4 | 

SIM210.py:3:5: SIM210 [*] Remove unnecessary `True if ... else False`
  |
1 | a = True if b else False  # SIM210
2 | 
3 | a = True if b != c else False  # SIM210
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^ SIM210
4 | 
5 | a = True if b + c else False  # SIM210
  |
  = help: Remove unnecessary `True if ... else False`

ℹ Unsafe fix
1 1 | a = True if b else False  # SIM210
2 2 | 
3   |-a = True if b != c else False  # SIM210
  3 |+a = b != c  # SIM210
4 4 | 
5 5 | a = True if b + c else False  # SIM210
6 6 | 

SIM210.py:5:5: SIM210 [*] Use `bool(...)` instead of `True if ... else False`
  |
3 | a = True if b != c else False  # SIM210
4 | 
5 | a = True if b + c else False  # SIM210
  |     ^^^^^^^^^^^^^^^^^^^^^^^^ SIM210
6 | 
7 | a = False if b else True  # OK
  |
  = help: Replace with `bool(...)

ℹ Unsafe fix
2 2 | 
3 3 | a = True if b != c else False  # SIM210
4 4 | 
5   |-a = True if b + c else False  # SIM210
  5 |+a = bool(b + c)  # SIM210
6 6 | 
7 7 | a = False if b else True  # OK
8 8 | 

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

SIM210.py:19:11: SIM210 [*] Remove unnecessary `True if ... else False`
   |
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
   | |____________________________________________________________________________^ SIM210
   |
   = help: Remove unnecessary `True if ... else False`

ℹ Unsafe fix
16 16 | 
17 17 | 
18 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
   19 |+samesld = (psl.privatesuffix(urlparse(response.url).netloc) ==
   20 |+                                   psl.privatesuffix(src.netloc))
