> It would be better if you actually validated the self.out_of_bounds value, and
> raised a ValueError in a final else clause.

Yes, that's very important, elsewhere typos go unoticed, and leave
uncomprehensible behaviors.