From 4e5f98468d8fc450e01c99450f43f0c77b543747 Mon Sep 17 00:00:00 2001 From: Shom770 <82843611+Shom770@users.noreply.github.com> Date: Wed, 12 Jan 2022 15:40:48 -0500 Subject: reverting back to original commit for a NamedTuple --- bot/exts/events/trivianight/_game.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'bot/exts') diff --git a/bot/exts/events/trivianight/_game.py b/bot/exts/events/trivianight/_game.py index 1526aa14..6d177783 100644 --- a/bot/exts/events/trivianight/_game.py +++ b/bot/exts/events/trivianight/_game.py @@ -1,7 +1,7 @@ import time from random import randrange from string import ascii_uppercase -from typing import Iterable, Optional, TypedDict +from typing import Iterable, NamedTuple, Optional, TypedDict DEFAULT_QUESTION_POINTS = 10 DEFAULT_QUESTION_TIME = 20 @@ -18,11 +18,12 @@ class QuestionData(TypedDict): time: Optional[int] -UserGuess = tuple[ - str, # Represents the answer choice the user chose. - bool, # Represents if the user can edit their answer. - float # Represents the amount of time passed since the question began. -] +class UserGuess(NamedTuple): + """Represents the user's guess for a question.""" + + answer: str + editable: bool + elapsed: float class QuestionClosed(RuntimeError): -- cgit v1.2.3