Skip to content

Commit c271630

Browse files
committed
Fix linter issues
1 parent 7b9b498 commit c271630

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python-magic-methods/number.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ def __init__(self, value):
33
self.value = value
44

55
def __add__(self, other):
6-
print(f"__add__ called")
6+
print("__add__ called")
77
if isinstance(other, Number):
88
return Number(self.value + other.value)
99
elif isinstance(other, int | float):
@@ -12,11 +12,11 @@ def __add__(self, other):
1212
raise TypeError("unsupported operand type for +")
1313

1414
def __radd__(self, other):
15-
print(f"__radd__ called")
15+
print("__radd__ called")
1616
return self.__add__(other)
1717

1818
def __iadd__(self, other):
19-
print(f"__iadd__ called")
19+
print("__iadd__ called")
2020
return self.__add__(other)
2121

2222
def __str__(self):

python-magic-methods/storage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ def __new__(cls, value, unit):
77
def __add__(self, other):
88
if not isinstance(other, type(self)):
99
raise TypeError(
10-
f"unsupported operand for +: "
10+
"unsupported operand for +: "
1111
f"'{type(self).__name__}' and '{type(other).__name__}'"
1212
)
1313
if not self.unit == other.unit:
@@ -20,7 +20,7 @@ def __add__(self, other):
2020
def __sub__(self, other):
2121
if not isinstance(other, type(self)):
2222
raise TypeError(
23-
f"unsupported operand for -: "
23+
"unsupported operand for -: "
2424
f"'{type(self).__name__}' and '{type(other).__name__}'"
2525
)
2626
if not self.unit == other.unit:

0 commit comments

Comments
 (0)