general: move assert_never to my.core.compat as it's in stdlib from 3.11

rely on typing-extensions for fallback

introducing typing-extensions dependency without fallback, should be ok since it's in the top 10 of popular packages
This commit is contained in:
Dima Gerasimov 2024-08-12 15:45:59 +03:00
parent 1317914bff
commit 8834001fe7
10 changed files with 36 additions and 16 deletions

View file

@ -6,7 +6,6 @@ from pathlib import Path
from typing import Dict, Iterator, Sequence
from my.core import get_files, Res, datetime_aware
from my.core.common import assert_never
from my.config import codeforces as config # type: ignore[attr-defined]
@ -73,7 +72,7 @@ class Parser:
# these contain only contests the user participated in
yield from self._parse_competitions(path)
else:
raise RuntimeError("shouldn't happen") # TODO switch to compat.assert_never
raise RuntimeError(f"shouldn't happen: {path.name}")
def data() -> Iterator[Res[Competition]]: