diff --git a/codes/python/chapter_hashing/array_hash_map.py b/codes/python/chapter_hashing/array_hash_map.py index 945f44bb0..e73973aa0 100644 --- a/codes/python/chapter_hashing/array_hash_map.py +++ b/codes/python/chapter_hashing/array_hash_map.py @@ -26,7 +26,7 @@ class ArrayHashMap: index = key % 100 return index - def get(self, key: int) -> str: + def get(self, key: int) -> str | None: """查询操作""" index: int = self.hash_func(key) pair: Pair = self.buckets[index] @@ -35,7 +35,7 @@ class ArrayHashMap: return pair.val def put(self, key: int, val: str): - """添加操作""" + """添加和更新操作""" pair = Pair(key, val) index: int = self.hash_func(key) self.buckets[index] = pair