Skip to content

Commit b133489

Browse files
committed
add type hint
1 parent 4e1ace3 commit b133489

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

category.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def __init__(self, name: str):
1919
def __hash__(self):
2020
return hash(self.name)
2121

22-
def __eq__(self, other):
22+
def __eq__(self, other: 'Category'):
2323
if isinstance(other, self.__class__):
2424
return self.name == other.name
2525
else:
@@ -74,10 +74,10 @@ def get_parent(self) -> 'Category':
7474
def get_childs(self) -> List['Category']:
7575
return list(self.childs.keys())
7676

77-
def get_category_list(self):
77+
def get_category_list(self) -> List[str]:
7878
return self.category_list
7979

80-
def set_category_list(self, category_list):
80+
def set_category_list(self, category_list: List[str]):
8181
self.category_list = category_list
8282

8383
def add_document(self, document_index: int) -> None:
@@ -86,7 +86,7 @@ def add_document(self, document_index: int) -> None:
8686
def get_documents(self) -> Set[int]:
8787
return self.documents
8888

89-
def get_documents_size(self):
89+
def get_documents_size(self) -> int:
9090
return len(self.documents)
9191

9292
def find_document(self, document_index: int) -> Optional['Category']:

0 commit comments

Comments
 (0)