why won't slicing lists raise IndexError?
Jason Maldonis
jjmaldonis at gmail.com
Mon Dec 4 16:03:56 EST 2017
More information about the Python-list mailing list
Mon Dec 4 16:03:56 EST 2017
- Previous message (by thread): why won't slicing lists raise IndexError?
- Next message (by thread): why won't slicing lists raise IndexError?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> > This is explained in the Python tutorial for strings > https://docs.python.org/3/tutorial/introduction.html#strings, as a list > is a sequence just like a string it will act in exactly the same way. > The only relevant bit I found in that link is: "However, out of range slice indexes are handled gracefully when used for slicing". I do understand _how_ slices work, but I would really like to know a bit more about why slices will never throw out-of-bounds IndexErrors.
- Previous message (by thread): why won't slicing lists raise IndexError?
- Next message (by thread): why won't slicing lists raise IndexError?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list