Skip to content

Commit 1d84234

Browse files
Fix UP047: use PEP 695 type parameter syntax in valid_input
1 parent 184d7ac commit 1d84234

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

machine_learning/linear_discriminant_analysis.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -249,10 +249,7 @@ def accuracy(actual_y: list, predicted_y: list) -> float:
249249
return (correct / len(actual_y)) * 100
250250

251251

252-
num = TypeVar("num", int, float)
253-
254-
255-
def valid_input(
252+
def valid_input[num](
256253
input_type: Callable[[object], num], # Usually float or int
257254
input_msg: str,
258255
err_msg: str,

0 commit comments

Comments
 (0)