Skip to content

Commit b53983b

Browse files
Make dec_number required in NumberFormatterHelper.standardize
The only caller always passes dec_number, so the None fallback was dead code that could not be reached in normal operation.
1 parent 6b059f5 commit b53983b

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

pylint/checkers/format.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,11 @@ def standardize(
8888
cls,
8989
number: float,
9090
original_string: str,
91+
dec_number: Decimal,
9192
scientific: bool = True,
9293
engineering: bool = True,
9394
pep515: bool = True,
94-
dec_number: Decimal | None = None,
9595
) -> str:
96-
if dec_number is None:
97-
dec_number = Decimal(original_string)
9896
dec_tuple = dec_number.as_tuple()
9997
# float64 guarantees only 15 significant digits; cap suggestions
10098
# to avoid implying false precision.
@@ -810,10 +808,10 @@ def add_bad_notation_message(reason: str) -> None:
810808
suggestion = NumberFormatterHelper.standardize(
811809
value,
812810
string,
811+
dec_number,
813812
scientific,
814813
engineering,
815814
pep515,
816-
dec_number,
817815
)
818816
if suggestion == string.lower():
819817
return

0 commit comments

Comments
 (0)