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

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

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

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

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

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

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

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