Also, I can update the assert, but it would give in `IndexError` otherwise anyway (while for `key < 0` it would cause undefined behaviour which we should avoid).