---
source: crates/ruff_linter/src/rules/refurb/mod.rs
---
FURB164 [*] Verbose method `from_float` in `Fraction` construction
 --> FURB164.py:7:5
  |
6 | # Errors
7 | _ = Fraction.from_float(0.1)
  |     ^^^^^^^^^^^^^^^^^^^^^^^^
8 | _ = Fraction.from_float(-0.5)
9 | _ = Fraction.from_float(5.0)
  |
help: Replace with `Fraction` constructor
  |
6 | # Errors
  - _ = Fraction.from_float(0.1)
7 + _ = Fraction(0.1)
8 | _ = Fraction.from_float(-0.5)
  |

FURB164 [*] Verbose method `from_float` in `Fraction` construction
  --> FURB164.py:8:5
   |
 6 | # Errors
 7 | _ = Fraction.from_float(0.1)
 8 | _ = Fraction.from_float(-0.5)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
 9 | _ = Fraction.from_float(5.0)
10 | _ = fractions.Fraction.from_float(4.2)
   |
help: Replace with `Fraction` constructor
  |
7 | _ = Fraction.from_float(0.1)
  - _ = Fraction.from_float(-0.5)
8 + _ = Fraction(-0.5)
9 | _ = Fraction.from_float(5.0)
  |

FURB164 [*] Verbose method `from_float` in `Fraction` construction
  --> FURB164.py:9:5
   |
 7 | _ = Fraction.from_float(0.1)
 8 | _ = Fraction.from_float(-0.5)
 9 | _ = Fraction.from_float(5.0)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
10 | _ = fractions.Fraction.from_float(4.2)
11 | _ = Fraction.from_decimal(Decimal("4.2"))
   |
help: Replace with `Fraction` constructor
   |
8  | _ = Fraction.from_float(-0.5)
   - _ = Fraction.from_float(5.0)
9  + _ = Fraction(5.0)
10 | _ = fractions.Fraction.from_float(4.2)
   |

FURB164 [*] Verbose method `from_float` in `Fraction` construction
  --> FURB164.py:10:5
   |
 8 | _ = Fraction.from_float(-0.5)
 9 | _ = Fraction.from_float(5.0)
10 | _ = fractions.Fraction.from_float(4.2)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
11 | _ = Fraction.from_decimal(Decimal("4.2"))
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
   |
help: Replace with `Fraction` constructor
   |
9  | _ = Fraction.from_float(5.0)
   - _ = fractions.Fraction.from_float(4.2)
10 + _ = fractions.Fraction(4.2)
11 | _ = Fraction.from_decimal(Decimal("4.2"))
   |

FURB164 [*] Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:11:5
   |
 9 | _ = Fraction.from_float(5.0)
10 | _ = fractions.Fraction.from_float(4.2)
11 | _ = Fraction.from_decimal(Decimal("4.2"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
   |
help: Replace with `Fraction` constructor
   |
10 | _ = fractions.Fraction.from_float(4.2)
   - _ = Fraction.from_decimal(Decimal("4.2"))
11 + _ = Fraction(Decimal("4.2"))
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
   |

FURB164 [*] Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:12:5
   |
10 | _ = fractions.Fraction.from_float(4.2)
11 | _ = Fraction.from_decimal(Decimal("4.2"))
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
14 | _ = Decimal.from_float(0.1)
   |
help: Replace with `Fraction` constructor
   |
11 | _ = Fraction.from_decimal(Decimal("4.2"))
   - _ = Fraction.from_decimal(Decimal("-4.2"))
12 + _ = Fraction(Decimal("-4.2"))
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
   |

FURB164 [*] Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:13:5
   |
11 | _ = Fraction.from_decimal(Decimal("4.2"))
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
14 | _ = Decimal.from_float(0.1)
15 | _ = Decimal.from_float(-0.5)
   |
help: Replace with `Fraction` constructor
   |
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
   - _ = Fraction.from_decimal(Decimal.from_float(4.2))
13 + _ = Fraction(Decimal.from_float(4.2))
14 | _ = Decimal.from_float(0.1)
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:13:27
   |
11 | _ = Fraction.from_decimal(Decimal("4.2"))
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
   |                           ^^^^^^^^^^^^^^^^^^^^^^^
14 | _ = Decimal.from_float(0.1)
15 | _ = Decimal.from_float(-0.5)
   |
help: Replace with `Decimal` constructor
   |
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
   - _ = Fraction.from_decimal(Decimal.from_float(4.2))
13 + _ = Fraction.from_decimal(Decimal(4.2))
14 | _ = Decimal.from_float(0.1)
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:14:5
   |
12 | _ = Fraction.from_decimal(Decimal("-4.2"))
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
14 | _ = Decimal.from_float(0.1)
   |     ^^^^^^^^^^^^^^^^^^^^^^^
15 | _ = Decimal.from_float(-0.5)
16 | _ = Decimal.from_float(5.0)
   |
help: Replace with `Decimal` constructor
   |
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
   - _ = Decimal.from_float(0.1)
14 + _ = Decimal(0.1)
15 | _ = Decimal.from_float(-0.5)
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:15:5
   |
13 | _ = Fraction.from_decimal(Decimal.from_float(4.2))
14 | _ = Decimal.from_float(0.1)
15 | _ = Decimal.from_float(-0.5)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
16 | _ = Decimal.from_float(5.0)
17 | _ = decimal.Decimal.from_float(4.2)
   |
help: Replace with `Decimal` constructor
   |
14 | _ = Decimal.from_float(0.1)
   - _ = Decimal.from_float(-0.5)
15 + _ = Decimal(-0.5)
16 | _ = Decimal.from_float(5.0)
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:16:5
   |
14 | _ = Decimal.from_float(0.1)
15 | _ = Decimal.from_float(-0.5)
16 | _ = Decimal.from_float(5.0)
   |     ^^^^^^^^^^^^^^^^^^^^^^^
17 | _ = decimal.Decimal.from_float(4.2)
18 | _ = Decimal.from_float(float("inf"))
   |
help: Replace with `Decimal` constructor
   |
15 | _ = Decimal.from_float(-0.5)
   - _ = Decimal.from_float(5.0)
16 + _ = Decimal(5.0)
17 | _ = decimal.Decimal.from_float(4.2)
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:17:5
   |
15 | _ = Decimal.from_float(-0.5)
16 | _ = Decimal.from_float(5.0)
17 | _ = decimal.Decimal.from_float(4.2)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
18 | _ = Decimal.from_float(float("inf"))
19 | _ = Decimal.from_float(float("-inf"))
   |
help: Replace with `Decimal` constructor
   |
16 | _ = Decimal.from_float(5.0)
   - _ = decimal.Decimal.from_float(4.2)
17 + _ = decimal.Decimal(4.2)
18 | _ = Decimal.from_float(float("inf"))
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:18:5
   |
16 | _ = Decimal.from_float(5.0)
17 | _ = decimal.Decimal.from_float(4.2)
18 | _ = Decimal.from_float(float("inf"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19 | _ = Decimal.from_float(float("-inf"))
20 | _ = Decimal.from_float(float("Infinity"))
   |
help: Replace with `Decimal` constructor
   |
17 | _ = decimal.Decimal.from_float(4.2)
   - _ = Decimal.from_float(float("inf"))
18 + _ = Decimal("inf")
19 | _ = Decimal.from_float(float("-inf"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:19:5
   |
17 | _ = decimal.Decimal.from_float(4.2)
18 | _ = Decimal.from_float(float("inf"))
19 | _ = Decimal.from_float(float("-inf"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
20 | _ = Decimal.from_float(float("Infinity"))
21 | _ = Decimal.from_float(float("-Infinity"))
   |
help: Replace with `Decimal` constructor
   |
18 | _ = Decimal.from_float(float("inf"))
   - _ = Decimal.from_float(float("-inf"))
19 + _ = Decimal("-inf")
20 | _ = Decimal.from_float(float("Infinity"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:20:5
   |
18 | _ = Decimal.from_float(float("inf"))
19 | _ = Decimal.from_float(float("-inf"))
20 | _ = Decimal.from_float(float("Infinity"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 | _ = Decimal.from_float(float("-Infinity"))
22 | _ = Decimal.from_float(float("nan"))
   |
help: Replace with `Decimal` constructor
   |
19 | _ = Decimal.from_float(float("-inf"))
   - _ = Decimal.from_float(float("Infinity"))
20 + _ = Decimal("infinity")
21 | _ = Decimal.from_float(float("-Infinity"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:21:5
   |
19 | _ = Decimal.from_float(float("-inf"))
20 | _ = Decimal.from_float(float("Infinity"))
21 | _ = Decimal.from_float(float("-Infinity"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
22 | _ = Decimal.from_float(float("nan"))
23 | _ = Decimal.from_float(float("-NaN "))
   |
help: Replace with `Decimal` constructor
   |
20 | _ = Decimal.from_float(float("Infinity"))
   - _ = Decimal.from_float(float("-Infinity"))
21 + _ = Decimal("-infinity")
22 | _ = Decimal.from_float(float("nan"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:22:5
   |
20 | _ = Decimal.from_float(float("Infinity"))
21 | _ = Decimal.from_float(float("-Infinity"))
22 | _ = Decimal.from_float(float("nan"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23 | _ = Decimal.from_float(float("-NaN "))
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
   |
help: Replace with `Decimal` constructor
   |
21 | _ = Decimal.from_float(float("-Infinity"))
   - _ = Decimal.from_float(float("nan"))
22 + _ = Decimal("nan")
23 | _ = Decimal.from_float(float("-NaN "))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:23:5
   |
21 | _ = Decimal.from_float(float("-Infinity"))
22 | _ = Decimal.from_float(float("nan"))
23 | _ = Decimal.from_float(float("-NaN "))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
25 | _ = Decimal.from_float(float("  iNf \n\t "))
   |
help: Replace with `Decimal` constructor
   |
22 | _ = Decimal.from_float(float("nan"))
   - _ = Decimal.from_float(float("-NaN "))
23 + _ = Decimal("nan")
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:24:5
   |
22 | _ = Decimal.from_float(float("nan"))
23 | _ = Decimal.from_float(float("-NaN "))
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
25 | _ = Decimal.from_float(float("  iNf \n\t "))
26 | _ = Decimal.from_float(float("   -inF\n \t"))
   |
help: Replace with `Decimal` constructor
   |
23 | _ = Decimal.from_float(float("-NaN "))
   - _ = Decimal.from_float(float(" \n+nan   \t"))
24 + _ = Decimal("+nan")
25 | _ = Decimal.from_float(float("  iNf \n\t "))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:25:5
   |
23 | _ = Decimal.from_float(float("-NaN "))
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
25 | _ = Decimal.from_float(float("  iNf \n\t "))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
26 | _ = Decimal.from_float(float("   -inF\n \t"))
27 | _ = Decimal.from_float(float("  InfinIty \n\t "))
   |
help: Replace with `Decimal` constructor
   |
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
   - _ = Decimal.from_float(float("  iNf \n\t "))
25 + _ = Decimal("inf")
26 | _ = Decimal.from_float(float("   -inF\n \t"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:26:5
   |
24 | _ = Decimal.from_float(float(" \n+nan   \t"))
25 | _ = Decimal.from_float(float("  iNf \n\t "))
26 | _ = Decimal.from_float(float("   -inF\n \t"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
27 | _ = Decimal.from_float(float("  InfinIty \n\t "))
28 | _ = Decimal.from_float(float("   -InfinIty\n \t"))
   |
help: Replace with `Decimal` constructor
   |
25 | _ = Decimal.from_float(float("  iNf \n\t "))
   - _ = Decimal.from_float(float("   -inF\n \t"))
26 + _ = Decimal("-inf")
27 | _ = Decimal.from_float(float("  InfinIty \n\t "))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:27:5
   |
25 | _ = Decimal.from_float(float("  iNf \n\t "))
26 | _ = Decimal.from_float(float("   -inF\n \t"))
27 | _ = Decimal.from_float(float("  InfinIty \n\t "))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28 | _ = Decimal.from_float(float("   -InfinIty\n \t"))
   |
help: Replace with `Decimal` constructor
   |
26 | _ = Decimal.from_float(float("   -inF\n \t"))
   - _ = Decimal.from_float(float("  InfinIty \n\t "))
27 + _ = Decimal("infinity")
28 | _ = Decimal.from_float(float("   -InfinIty\n \t"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:28:5
   |
26 | _ = Decimal.from_float(float("   -inF\n \t"))
27 | _ = Decimal.from_float(float("  InfinIty \n\t "))
28 | _ = Decimal.from_float(float("   -InfinIty\n \t"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
29 |
30 | # Cases with keyword arguments - should produce unsafe fixes
   |
help: Replace with `Decimal` constructor
   |
27 | _ = Decimal.from_float(float("  InfinIty \n\t "))
   - _ = Decimal.from_float(float("   -InfinIty\n \t"))
28 + _ = Decimal("-infinity")
29 |
   |

FURB164 [*] Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:31:5
   |
30 | # Cases with keyword arguments - should produce unsafe fixes
31 | _ = Fraction.from_decimal(dec=Decimal("4.2"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32 | _ = Decimal.from_float(f=4.2)
   |
help: Replace with `Fraction` constructor
   |
30 | # Cases with keyword arguments - should produce unsafe fixes
   - _ = Fraction.from_decimal(dec=Decimal("4.2"))
31 + _ = Fraction(Decimal("4.2"))
32 | _ = Decimal.from_float(f=4.2)
   |

FURB164 Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:32:5
   |
30 | # Cases with keyword arguments - should produce unsafe fixes
31 | _ = Fraction.from_decimal(dec=Decimal("4.2"))
32 | _ = Decimal.from_float(f=4.2)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
33 |
34 | # Cases with invalid argument counts - should not get fixes
   |
help: Replace with `Decimal` constructor

FURB164 Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:35:5
   |
34 | # Cases with invalid argument counts - should not get fixes
35 | _ = Fraction.from_decimal(Decimal("4.2"), 1)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
36 | _ = Decimal.from_float(4.2, None)
   |
help: Replace with `Fraction` constructor

FURB164 Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:36:5
   |
34 | # Cases with invalid argument counts - should not get fixes
35 | _ = Fraction.from_decimal(Decimal("4.2"), 1)
36 | _ = Decimal.from_float(4.2, None)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
37 |
38 | # Cases with wrong keyword arguments - should not get fixes  
   |
help: Replace with `Decimal` constructor

FURB164 Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:39:5
   |
38 | # Cases with wrong keyword arguments - should not get fixes  
39 | _ = Fraction.from_decimal(numerator=Decimal("4.2"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
40 | _ = Decimal.from_float(value=4.2)
   |
help: Replace with `Fraction` constructor

FURB164 Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:40:5
   |
38 | # Cases with wrong keyword arguments - should not get fixes  
39 | _ = Fraction.from_decimal(numerator=Decimal("4.2"))
40 | _ = Decimal.from_float(value=4.2)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41 |
42 | # Cases with type validation issues - should produce unsafe fixes
   |
help: Replace with `Decimal` constructor

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:43:5
   |
42 | # Cases with type validation issues - should produce unsafe fixes
43 | _ = Decimal.from_float("4.2")  # Invalid type for from_float
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^
44 | _ = Fraction.from_decimal(4.2)  # Invalid type for from_decimal
45 | _ = Fraction.from_float("4.2")  # Invalid type for from_float
   |
help: Replace with `Decimal` constructor
   |
42 | # Cases with type validation issues - should produce unsafe fixes
   - _ = Decimal.from_float("4.2")  # Invalid type for from_float
43 + _ = Decimal("4.2")  # Invalid type for from_float
44 | _ = Fraction.from_decimal(4.2)  # Invalid type for from_decimal
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:44:5
   |
42 | # Cases with type validation issues - should produce unsafe fixes
43 | _ = Decimal.from_float("4.2")  # Invalid type for from_float
44 | _ = Fraction.from_decimal(4.2)  # Invalid type for from_decimal
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
45 | _ = Fraction.from_float("4.2")  # Invalid type for from_float
   |
help: Replace with `Fraction` constructor
   |
43 | _ = Decimal.from_float("4.2")  # Invalid type for from_float
   - _ = Fraction.from_decimal(4.2)  # Invalid type for from_decimal
44 + _ = Fraction(4.2)  # Invalid type for from_decimal
45 | _ = Fraction.from_float("4.2")  # Invalid type for from_float
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Fraction` construction
  --> FURB164.py:45:5
   |
43 | _ = Decimal.from_float("4.2")  # Invalid type for from_float
44 | _ = Fraction.from_decimal(4.2)  # Invalid type for from_decimal
45 | _ = Fraction.from_float("4.2")  # Invalid type for from_float
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
46 |
47 | # OK - should not trigger the rule
   |
help: Replace with `Fraction` constructor
   |
44 | _ = Fraction.from_decimal(4.2)  # Invalid type for from_decimal
   - _ = Fraction.from_float("4.2")  # Invalid type for from_float
45 + _ = Fraction("4.2")  # Invalid type for from_float
46 |
   |
note: This is an unsafe fix and may change runtime behavior

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:60:5
   |
59 | # Cases with int and bool - should produce safe fixes
60 | _ = Decimal.from_float(1)
   |     ^^^^^^^^^^^^^^^^^^^^^
61 | _ = Decimal.from_float(True)
   |
help: Replace with `Decimal` constructor
   |
59 | # Cases with int and bool - should produce safe fixes
   - _ = Decimal.from_float(1)
60 + _ = Decimal(1)
61 | _ = Decimal.from_float(True)
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:61:5
   |
59 | # Cases with int and bool - should produce safe fixes
60 | _ = Decimal.from_float(1)
61 | _ = Decimal.from_float(True)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^
62 |
63 | # Cases with non-finite floats - should produce safe fixes
   |
help: Replace with `Decimal` constructor
   |
60 | _ = Decimal.from_float(1)
   - _ = Decimal.from_float(True)
61 + _ = Decimal(True)
62 |
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:64:5
   |
63 | # Cases with non-finite floats - should produce safe fixes
64 | _ = Decimal.from_float(float("-nan"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
65 | _ = Decimal.from_float(float("\x2dnan"))
66 | _ = Decimal.from_float(float("\N{HYPHEN-MINUS}nan"))
   |
help: Replace with `Decimal` constructor
   |
63 | # Cases with non-finite floats - should produce safe fixes
   - _ = Decimal.from_float(float("-nan"))
64 + _ = Decimal("nan")
65 | _ = Decimal.from_float(float("\x2dnan"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:65:5
   |
63 | # Cases with non-finite floats - should produce safe fixes
64 | _ = Decimal.from_float(float("-nan"))
65 | _ = Decimal.from_float(float("\x2dnan"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66 | _ = Decimal.from_float(float("\N{HYPHEN-MINUS}nan"))
   |
help: Replace with `Decimal` constructor
   |
64 | _ = Decimal.from_float(float("-nan"))
   - _ = Decimal.from_float(float("\x2dnan"))
65 + _ = Decimal("nan")
66 | _ = Decimal.from_float(float("\N{HYPHEN-MINUS}nan"))
   |

FURB164 [*] Verbose method `from_float` in `Decimal` construction
  --> FURB164.py:66:5
   |
64 | _ = Decimal.from_float(float("-nan"))
65 | _ = Decimal.from_float(float("\x2dnan"))
66 | _ = Decimal.from_float(float("\N{HYPHEN-MINUS}nan"))
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
67 |
68 | # See: https://github.com/astral-sh/ruff/issues/21257
   |
help: Replace with `Decimal` constructor
   |
65 | _ = Decimal.from_float(float("\x2dnan"))
   - _ = Decimal.from_float(float("\N{HYPHEN-MINUS}nan"))
66 + _ = Decimal("nan")
67 |
   |

FURB164 [*] Verbose method `from_float` in `Fraction` construction
  --> FURB164.py:70:5
   |
68 | # See: https://github.com/astral-sh/ruff/issues/21257
69 | # fixes must be safe
70 | _ = Fraction.from_float(f=4.2)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
71 | _ = Fraction.from_decimal(dec=4)
   |
help: Replace with `Fraction` constructor
   |
69 | # fixes must be safe
   - _ = Fraction.from_float(f=4.2)
70 + _ = Fraction(4.2)
71 | _ = Fraction.from_decimal(dec=4)
   |

FURB164 [*] Verbose method `from_decimal` in `Fraction` construction
  --> FURB164.py:71:5
   |
69 | # fixes must be safe
70 | _ = Fraction.from_float(f=4.2)
71 | _ = Fraction.from_decimal(dec=4)
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
72 |
73 | _ = (
   |
help: Replace with `Fraction` constructor
   |
70 | _ = Fraction.from_float(f=4.2)
   - _ = Fraction.from_decimal(dec=4)
71 + _ = Fraction(4)
72 |
   |

FURB164 [*] Verbose method `from_float` in `Fraction` construction
  --> FURB164.py:74:5
   |
73 |   _ = (
74 | /     Fraction
75 | |     # text
76 | |     .from_float(4.2)
   | |____________________^
77 |   )
   |
help: Replace with `Fraction` constructor
   |
73 | _ = (
   -     Fraction
   -     # text
   -     .from_float(4.2)
74 +     Fraction(4.2)
75 | )
   |
note: This is an unsafe fix and may change runtime behavior
