how to write a generator that returns all-but-last items in the iterable in python?,"list(allbutlast([1, 2, 3]))"