Skip to content

Commit ea5ac79

Browse files
committed
Fixed types for Router
1 parent f6bc58d commit ea5ac79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

patterns/structural/mvc.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def item_not_found(self, item_type: str, item_name: str) -> None:
7272

7373
class ConsoleView(View):
7474
"""The View is the presentation layer of the application."""
75-
def show_item_list(self, item_type: str, item_list: dict) -> None:
75+
def show_item_list(self, item_type: str, item_list: list) -> None:
7676
print(item_type.upper() + " LIST:")
7777
for item in item_list:
7878
print(item)
@@ -113,7 +113,7 @@ def show_item_information(self, item_name: str) -> None:
113113
:param str item_name: the name of the {item_type} item to show information about
114114
"""
115115
try:
116-
item_info: str = self.model.get(item_name)
116+
item_info: dict = self.model.get(item_name)
117117
except Exception:
118118
item_type: str = self.model.item_type
119119
self.view.item_not_found(item_type, item_name)
@@ -127,7 +127,7 @@ class Router:
127127
def __init__(self):
128128
self.routes = {}
129129

130-
def register(self, path: str, controller_class: Controller, model_class: Model, view_class: View) -> None:
130+
def register(self, path: str, controller_class: type[Controller], model_class: type[Model], view_class: type[View]) -> None:
131131
model_instance: Model = model_class()
132132
view_instance: View = view_class()
133133
self.routes[path] = controller_class(model_instance, view_instance)

0 commit comments

Comments
 (0)