You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
verbose-decimal-constructor (FURB157) has false negatives in Ruff 0.8.0 for some non-finite float strings. It recognizes the following strings case-insensitively in expressions like Decimal(float("inf")), but no others:
float strips white space. For example, Decimal(float(" nan ")) should be simplified to Decimal(" nan "). It could be further normalized to Decimal("NaN"), but FURB157 does not currently normalize other float strings, so I think it should keep the string argument unchanged.
float allows both signs for all non-finite values. Decimal(float("+inf")), Decimal(float("+infinity")), Decimal(float("+nan")), and Decimal(float("-nan")) should be simplified. FURB157 should not normalize these string arguments either, except for the last one. Decimal(float("-nan")) is equivalent to Decimal("nan"), not Decimal("-nan"), so for an argument of "-nan", the sign character should be deleted.
The text was updated successfully, but these errors were encountered:
verbose-decimal-constructor
(FURB157) has false negatives in Ruff 0.8.0 for some non-finite float strings. It recognizes the following strings case-insensitively in expressions likeDecimal(float("inf"))
, but no others:ruff/crates/ruff_linter/src/rules/refurb/rules/verbose_decimal_constructor.rs
Line 157 in a90e404
float
strips white space. For example,Decimal(float(" nan "))
should be simplified toDecimal(" nan ")
. It could be further normalized toDecimal("NaN")
, but FURB157 does not currently normalize other float strings, so I think it should keep the string argument unchanged.float
allows both signs for all non-finite values.Decimal(float("+inf"))
,Decimal(float("+infinity"))
,Decimal(float("+nan"))
, andDecimal(float("-nan"))
should be simplified. FURB157 should not normalize these string arguments either, except for the last one.Decimal(float("-nan"))
is equivalent toDecimal("nan")
, notDecimal("-nan")
, so for an argument of"-nan"
, the sign character should be deleted.The text was updated successfully, but these errors were encountered: