---
source: crates/ruff_linter/src/rules/pylint/mod.rs
---
PLR2004 Magic value used in comparison, consider replacing `10` with a constant variable
 --> magic_value_comparison.py:5:4
  |
3 | user_input = 10
4 |
5 | if 10 > user_input:  # [magic-value-comparison]
  |    ^^
6 |     pass
  |

PLR2004 Magic value used in comparison, consider replacing `2` with a constant variable
  --> magic_value_comparison.py:47:12
   |
45 |     pass
46 |
47 | if argc != 2:  # [magic-value-comparison]
   |            ^
48 |     pass
   |

PLR2004 Magic value used in comparison, consider replacing `-2` with a constant variable
  --> magic_value_comparison.py:50:12
   |
48 |     pass
49 |
50 | if argc != -2:  # [magic-value-comparison]
   |            ^^
51 |     pass
   |

PLR2004 Magic value used in comparison, consider replacing `+2` with a constant variable
  --> magic_value_comparison.py:53:12
   |
51 |     pass
52 |
53 | if argc != +2:  # [magic-value-comparison]
   |            ^^
54 |     pass
   |

PLR2004 Magic value used in comparison, consider replacing `-2.0` with a constant variable
  --> magic_value_comparison.py:56:12
   |
54 |     pass
55 |
56 | if argc != -2.0:  # [magic-value-comparison]
   |            ^^^^
57 |     pass
   |

PLR2004 Magic value used in comparison, consider replacing `+2.0` with a constant variable
  --> magic_value_comparison.py:59:12
   |
57 |     pass
58 |
59 | if argc != +2.0:  # [magic-value-comparison]
   |            ^^^^
60 |     pass
   |

PLR2004 Magic value used in comparison, consider replacing `3.141592653589793238` with a constant variable
  --> magic_value_comparison.py:80:21
   |
78 | pi_estimation = 3.14
79 |
80 | if pi_estimation == 3.141592653589793238:  # [magic-value-comparison]
   |                     ^^^^^^^^^^^^^^^^^^^^
81 |     pass
   |

PLR2004 Magic value used in comparison, consider replacing `0x3` with a constant variable
  --> magic_value_comparison.py:86:21
   |
84 |     pass
85 |
86 | if pi_estimation == 0x3:  # [magic-value-comparison]
   |                     ^^^
87 |     pass
   |
