The mistake is suggesting the unpacking without caveats, because it'll fail in situations that the naive solution doesn't:
items = [1] first = items[0] middle = items[1:-1] last = items[-1]
The mistake is suggesting the unpacking without caveats, because it'll fail in situations that the naive solution doesn't:
This will still work as long as you have any elements.