Exhaustive Checks with Mypy
If you want to exhaustively check an enum (or a literal) and have Mypy tell you when you forgot a case, you can write yourself a tiny utility function: from typing import NoReturn def unreachable(v: NoReturn) -> NoReturn: raise AssertionError() ...
Jan 26, 20231 min read48
