Should perhaps be `ValueError` (there's no Python type mismatch)