@@ -26,7 +26,7 @@ class DAWG:
2626 def __init__ (self ) -> None :
2727 self .dct = None
2828
29- def __contains__ (self , key ) -> bool :
29+ def __contains__ (self , key : str | bytes ) -> bool :
3030 if not isinstance (key , bytes ):
3131 key = key .encode ("utf8" )
3232 return self .dct .contains (key )
@@ -73,7 +73,7 @@ def _similar_keys(self, current_prefix: str, key: str, index: int, replace_chars
7373
7474 return res
7575
76- def similar_keys (self , key : str , replaces : CompiledReplaces ):
76+ def similar_keys (self , key : str , replaces : CompiledReplaces ) -> list [ str ] :
7777 """
7878 Returns all variants of ``key`` in this DAWG according to
7979 ``replaces``.
@@ -202,7 +202,7 @@ def __contains__(self, key: str | bytes) -> bool:
202202 key = key .encode ("utf8" )
203203 return bool (self ._follow_key (key ))
204204
205- def __getitem__ (self , key ) :
205+ def __getitem__ (self , key : str | bytes ) -> list [ bytes ] :
206206 res = self .get (key )
207207 if res is None :
208208 raise KeyError (key )
@@ -241,7 +241,7 @@ def _value_for_index(self, index: int) -> list[bytes]:
241241
242242 return res
243243
244- def b_get_value (self , b_key ) -> list [bytes ]:
244+ def b_get_value (self , b_key : bytes ) -> list [bytes ]:
245245 index = self ._follow_key (b_key )
246246 if not index :
247247 return []
0 commit comments