core/general: add assert_never + typing annotations for dataset

This commit is contained in:
Dima Gerasimov 2022-06-03 20:31:13 +01:00
parent fd1a683d49
commit 59c6b126be
8 changed files with 54 additions and 19 deletions

View file

@ -79,7 +79,7 @@ class Message:
from typing import Union
from itertools import count
import json
from ..core import Res
from ..core import Res, assert_never
# todo cache it
def _entities() -> Iterator[Res[Union[Server, Sender, _Message]]]:
# TODO hmm -- not sure if max lexicographically will actually be latest?
@ -169,4 +169,4 @@ def messages() -> Iterator[Res[Message]]:
content=x.content,
)
continue
assert False # should be unreachable
assert_never(x)