Skip to content

Commit 551cce9

Browse files
authored
Language edit
1 parent c271630 commit 551cce9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python-magic-methods/distance.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ def __init__(self, value, unit="m"):
1010
self.value = value
1111
self.unit = unit.lower()
1212

13-
def to_metre(self):
13+
def to_meter(self):
1414
return self.value * type(self)._multiples[self.unit]
1515

1616
def __add__(self, other):
@@ -20,7 +20,7 @@ def __sub__(self, other):
2020
return self._compute(other, "-")
2121

2222
def _compute(self, other, operator):
23-
operation = eval(f"{self.to_metre()} {operator} {other.to_metre()}")
23+
operation = eval(f"{self.to_meter()} {operator} {other.to_meter()}")
2424
cls = type(self)
2525
return cls(operation / cls._multiples[self.unit], self.unit)
2626

0 commit comments

Comments
 (0)