---
source: crates/ruff_linter/src/rules/ruff/mod.rs
---
RUF032 [*] `Decimal()` called with float literal argument
 --> RUF032.py:6:17
  |
4 | decimal.Decimal(0)
5 |
6 | decimal.Decimal(0.0)  # Should error
  |                 ^^^
7 |
8 | decimal.Decimal("0.0")
  |
help: Replace with string literal
  |
5 |
  - decimal.Decimal(0.0)  # Should error
6 + decimal.Decimal("0.0")  # Should error
7 |
  |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:12:17
   |
10 | decimal.Decimal(10)
11 |
12 | decimal.Decimal(10.0)  # Should error
   |                 ^^^^
13 |
14 | decimal.Decimal("10.0")
   |
help: Replace with string literal
   |
11 |
   - decimal.Decimal(10.0)  # Should error
12 + decimal.Decimal("10.0")  # Should error
13 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:18:17
   |
16 | decimal.Decimal(-10)
17 |
18 | decimal.Decimal(-10.0)  # Should error
   |                 ^^^^^
19 |
20 | decimal.Decimal("-10.0")
   |
help: Replace with string literal
   |
17 |
   - decimal.Decimal(-10.0)  # Should error
18 + decimal.Decimal("-10.0")  # Should error
19 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:33:15
   |
31 | val = Decimal(0)
32 |
33 | val = Decimal(0.0)  # Should error
   |               ^^^
34 |
35 | val = Decimal("0.0")
   |
help: Replace with string literal
   |
32 |
   - val = Decimal(0.0)  # Should error
33 + val = Decimal("0.0")  # Should error
34 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:39:15
   |
37 | val = Decimal(10)
38 |
39 | val = Decimal(10.0)  # Should error
   |               ^^^^
40 |
41 | val = Decimal("10.0")
   |
help: Replace with string literal
   |
38 |
   - val = Decimal(10.0)  # Should error
39 + val = Decimal("10.0")  # Should error
40 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:45:15
   |
43 | val = Decimal(-10)
44 |
45 | val = Decimal(-10.0)  # Should error
   |               ^^^^^
46 |
47 | val = Decimal("-10.0")
   |
help: Replace with string literal
   |
44 |
   - val = Decimal(-10.0)  # Should error
45 + val = Decimal("-10.0")  # Should error
46 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:56:15
   |
54 | val = Decimal(~4.0) # Skip
55 |
56 | val = Decimal(++4.0) # Suggest `Decimal("4.0")`
   |               ^^^^^
57 |
58 | val = Decimal(-+--++--4.0) # Suggest `Decimal("-4.0")` 
   |
help: Replace with string literal
   |
55 |
   - val = Decimal(++4.0) # Suggest `Decimal("4.0")`
56 + val = Decimal("4.0") # Suggest `Decimal("4.0")`
57 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:58:15
   |
56 | val = Decimal(++4.0) # Suggest `Decimal("4.0")`
57 |
58 | val = Decimal(-+--++--4.0) # Suggest `Decimal("-4.0")` 
   |               ^^^^^^^^^^^
   |
help: Replace with string literal
   |
57 |
   - val = Decimal(-+--++--4.0) # Suggest `Decimal("-4.0")` 
58 + val = Decimal("-4.0") # Suggest `Decimal("-4.0")` 
59 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:88:23
   |
86 | # Retest with fully qualified import
87 |
88 | val = decimal.Decimal(0.0)  # Should error
   |                       ^^^
89 |
90 | val = decimal.Decimal("0.0")
   |
help: Replace with string literal
   |
87 |
   - val = decimal.Decimal(0.0)  # Should error
88 + val = decimal.Decimal("0.0")  # Should error
89 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:92:23
   |
90 | val = decimal.Decimal("0.0")
91 |
92 | val = decimal.Decimal(10.0)  # Should error
   |                       ^^^^
93 |
94 | val = decimal.Decimal("10.0")
   |
help: Replace with string literal
   |
91 |
   - val = decimal.Decimal(10.0)  # Should error
92 + val = decimal.Decimal("10.0")  # Should error
93 |
   |
note: This is an unsafe fix and may change runtime behavior

RUF032 [*] `Decimal()` called with float literal argument
  --> RUF032.py:96:23
   |
94 | val = decimal.Decimal("10.0")
95 |
96 | val = decimal.Decimal(-10.0)  # Should error
   |                       ^^^^^
97 |
98 | val = decimal.Decimal("-10.0")
   |
help: Replace with string literal
   |
95 |
   - val = decimal.Decimal(-10.0)  # Should error
96 + val = decimal.Decimal("-10.0")  # Should error
97 |
   |
note: This is an unsafe fix and may change runtime behavior
