Skip to content

Commit e30dbf6

Browse files
committed
Store result from exposed function prior to returing
1 parent 2637454 commit e30dbf6

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

python/src/core_lib/math.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ def add(a: float, b: float) -> float:
1111
Returns:
1212
The sum of a and b.
1313
"""
14-
return _math.add(a, b)
14+
result: float = _math.add(a, b)
15+
return result
1516

1617

1718
def subtract(a: float, b: float) -> float:
@@ -24,7 +25,8 @@ def subtract(a: float, b: float) -> float:
2425
Returns:
2526
The result of a minus b.
2627
"""
27-
return _math.subtract(a, b)
28+
result: float = _math.subtract(a, b)
29+
return result
2830

2931

3032
def multiply(a: float, b: float) -> float:
@@ -37,7 +39,8 @@ def multiply(a: float, b: float) -> float:
3739
Returns:
3840
The product of a and b.
3941
"""
40-
return _math.multiply(a, b)
42+
result: float = _math.multiply(a, b)
43+
return result
4144

4245

4346
def divide(a: float, b: float) -> float:
@@ -53,4 +56,5 @@ def divide(a: float, b: float) -> float:
5356
Raises:
5457
ZeroDivisionError: If b is zero.
5558
"""
56-
return _math.divide(a, b)
59+
result: float = _math.divide(a, b)
60+
return result

0 commit comments

Comments
 (0)