Python slicing out of bounds never crashes

Indexing data[100] on a 3-element list crashes with IndexError, but slicing data[100:] returns an empty list with no error. Python silently clamps slice indices to the valid range. You can slice with absurdly large numbers and Python just gives you what it can.

#pythonweirdestlogic #pythonweirdbehavior #pythongotcha #pythontrick #pythonmindblown #pythonunexpected #pythonwtf #pythonhiddenfeature #pythonco...

https://www.youtube.com/watch?v=FgPkpyahr4k

Python slicing out of bounds never crashes #pythonlistbounds

YouTube