I am aware that if I wish to delete only the first element of a list t in Python I can do it with :
del t[0]
which is about as straightforward as it gets. However :
t = t[1:]
also works. In the textbook that I am learning from it says it is generally considered bad practice to use the latter approach since it does not delete the head of the list per se but
"The slice operator creates a new list and the assignment makes t refer to it, but none of that has any effect on the list that was passed as an argument."
Why is this bad ? Can you name an example where such an approach would significantly alter a function ? Thanks in advance.