Skip to content

Commit 64e413c

Browse files
authored
style: update valid_input to use Python 3.12 type parameters
Applied PEP 695 syntax to the valid_input function by moving the 'num' generic into brackets. This resolves the UP047 error in the machine_learning directory.
1 parent ca2306d commit 64e413c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

machine_learning/linear_discriminant_analysis.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ def accuracy(actual_y: list, predicted_y: list) -> float:
252252
num = TypeVar("num")
253253

254254

255-
def valid_input(
255+
def valid_input[num](
256256
input_type: Callable[[object], num], # Usually float or int
257257
input_msg: str,
258258
err_msg: str,

0 commit comments

Comments
 (0)