Why does Python allow out-of-range slice indexes for sequences?
Part of question regarding out-of-range indices Slice logic automatically clips the indices to the length of the sequence. Allowing slice indices to extend past end points was done for convenience. It would be a pain to have to range check every expression and then adjust the limits manually, so Python does it for you. Consider … Read more