Skip to content

Commit df578d1

Browse files
committed
yeah sure
1 parent 667632f commit df578d1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

patterns/structural/mvc.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
from abc import ABC, abstractmethod
77
from inspect import signature
88
from sys import argv
9+
from typing import Any
910

1011

1112
class Model(ABC):
@@ -72,7 +73,7 @@ def item_not_found(self, item_type: str, item_name: str) -> None:
7273

7374
class ConsoleView(View):
7475
"""The View is the presentation layer of the application."""
75-
def show_item_list(self, item_type: str, item_list: dict[any, any]) -> None:
76+
def show_item_list(self, item_type: str, item_list: dict[Any, Any]) -> None:
7677
print(item_type.upper() + " LIST:")
7778
for item in item_list:
7879
print(item)
@@ -112,10 +113,10 @@ def show_item_information(self, item_name: str) -> None:
112113
Show information about a {item_type} item.
113114
:param str item_name: the name of the {item_type} item to show information about
114115
"""
116+
item_type: str = self.model.item_type
115117
try:
116118
item_info: dict = self.model.get(item_name)
117119
except Exception:
118-
item_type: str = self.model.item_type
119120
self.view.item_not_found(item_type, item_name)
120121
else:
121122
self.view.show_item_information(item_type, item_name, item_info)

0 commit comments

Comments
 (0)