So I just came across what seems to me like a strange Python feature and wanted some clarification about it.
The following array manipulation somewhat makes sense:
p = [1,2,3] p[3:] =  p = [1,2,3,4]
I imagine it is actually just appending this value to the end, correct?
Why can I do this, however?
p[20:22] = [5,6] p = [1,2,3,4,5,6]
And even more so this:
p[20:100] = [7,8] p = [1,2,3,4,5,6,7,8]
This just seems like wrong logic. It seems like this should throw an error!
-Is it just a weird thing Python does?
-Is there a purpose to it?
-Or am I thinking about this the wrong way?