Skip to content

Commit 8022814

Browse files
Add regression test for pylint-dev#8109
1 parent d1b55f4 commit 8022814

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
"""Regression test for https://github.com/PyCQA/pylint/issues/8109."""
2+
3+
# pylint: disable=missing-docstring, unsupported-binary-operation
4+
5+
from dataclasses import dataclass
6+
7+
8+
@dataclass
9+
class Number:
10+
amount: int | float
11+
round: int = 2
12+
13+
def __str__(self):
14+
number_format = "{:,.%sf}" % self.round # [consider-using-f-string]
15+
return number_format.format(self.amount).rstrip("0").rstrip(".")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
consider-using-f-string:14:24:14:34:Number.__str__:Formatting a regular string which could be a f-string:UNDEFINED

0 commit comments

Comments
 (0)