Skip to content

Commit 515bbde

Browse files
Update score() return type to support int | float
Mypy reported an incompatible return type because function_to_optimize may return float values. Updated score() return type from int to int | float for full compatibility.
1 parent 5d8edae commit 515bbde

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

searches/hill_climbing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def __init__(
2929
self.step_size = step_size
3030
self.function = function_to_optimize
3131

32-
def score(self) -> int:
32+
def score(self) -> int | float:
3333
"""
3434
Returns the output of the function called with current x and y coordinates.
3535
>>> def test_function(x, y):

0 commit comments

Comments
 (0)