Skip to content

Commit 785aecd

Browse files
committed
updates
1 parent d8d39cb commit 785aecd

File tree

6 files changed

+14
-7
lines changed

6 files changed

+14
-7
lines changed

facade/game_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def submit_entry(user_id: str, entry: Decimal) -> bool:
3434
return GameEngine().submit_entry(user_id, entry)
3535

3636
@staticmethod
37-
def register_user(value: dict[str, str]) -> str:
37+
def register_user(value: dict[str, str]) -> str: # Python 3.9
38+
# def register_user(value) -> str: # Python 3.8 and earlier
3839
"register a new user and returns the new id"
3940
return Users.register_user(value)

facade/game_engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ class GameEngine():
1010
_instance = None
1111
_start_time: int = 0
1212
_clock: int = 0
13-
_entries: list[tuple[str, Decimal]] = []
13+
_entries: list[tuple[str, Decimal]] = [] # Python 3.9
14+
# _entries = [] # Python 3.8 or earlier
1415
_game_open = True
1516

1617
def __new__(cls):

facade/reports.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
class Reports():
66
"A Singleton Dictionary of Reported Events"
7-
_reports: dict[int, tuple[float, str]] = {}
7+
_reports: dict[int, tuple[float, str]] = {} # Python 3.9
8+
# _reports = {} # Python 3.8 or earlier
89
_row_id = 0
910

1011
def __new__(cls):

facade/users.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@
66

77
class Users():
88
"A Singleton Dictionary of Users"
9-
_users: dict[str, dict[str, str]] = {}
9+
_users: dict[str, dict[str, str]] = {} # Python 3.9
10+
# _users = {} # Python 3.8 or earlier
1011

1112
def __new__(cls):
1213
return cls
1314

1415
@classmethod
15-
def register_user(cls, new_user: dict[str, str]) -> str:
16+
def register_user(cls, new_user: dict[str, str]) -> str: # Python 3.9
17+
# def register_user(cls, new_user) -> str: # Python 3.8 or earlier
1618
"register a user"
1719
if not new_user["user_name"] in cls._users:
1820
# generate really complicated unique user_id.

facade/wallets.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55

66
class Wallets():
77
"A Singleton Dictionary of User Wallets"
8-
_wallets: dict[str, Decimal] = {}
8+
_wallets: dict[str, Decimal] = {} # Python 3.9
9+
# _wallets = {} # Python 3.8 or earlier
910

1011
def __new__(cls):
1112
return cls

interpreter/interpreter_concept.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ def __repr__(self):
6565
print(TOKENS)
6666

6767
# Manually Creating an Abstract Syntax Tree from the tokens
68-
AST: list[AbstractExpression] = [] # A list of AbstractExpressions
68+
AST: list[AbstractExpression] = [] # Python 3.9
69+
# AST = [] # Python 3.8 or earlier
6970
AST.append(Add(Number(TOKENS[0]), Number(TOKENS[2]))) # 5 + 4
7071
AST.append(Subtract(AST[0], Number(TOKENS[4]))) # ^ - 3
7172
AST.append(Add(AST[1], Number(TOKENS[6]))) # ^ + 7

0 commit comments

Comments
 (0)