Skip to content

Commit 5e935d8

Browse files
committed
use Callable generic rather than callable builtin
1 parent dc8597d commit 5e935d8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Python/chapter01/1.1 - Is Unique/miguel_1.1_sol.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
If the input is NOT a string, then raise a TypeError exception
1010
"""
1111
import unittest
12+
from typing import Callable
1213

1314

1415
def _validate_input_str(input_str: str) -> None:
@@ -72,7 +73,7 @@ def is_unique_no_additional_data_structures(input_str):
7273

7374

7475
class TestIsUniqueFunction(unittest.TestCase):
75-
def _run_tests(self, f: callable([[str], None])) -> None:
76+
def _run_tests(self, f: Callable[[str], None]) -> None:
7677
for case in ["techqueria", "bobby", "california"]:
7778
self.assertFalse(f(case), msg=case)
7879
for case in ["tacos", "swag", "orbit", "e"]:

0 commit comments

Comments
 (0)