What is the most efficient way to shift a list in python? Right now I have something like this:
>>> shift = lambda l, n: l[n:]+l[:n]
>>> l = [1,2,3]
>>> shift(l,1)
[2, 3, 1]
>>> shift(l,2)
[3, 1, 2]
>>> shift(l,0)
[1, 2, 3]
Is there a better way?