TypeError: 'dict_keys' object is not subscriptable
class Database:
def __init__(self):
self._items: typing.Dict[int, PhraseOutput] = {}
def get_random(self) -> int:
return random.choice(self._items.keys())
def get(self, id: int) -> typing.Optional[PhraseOutput]:
return self._items.get(id)