I'm trying to cycle from users' roles in my system.
I have a list from users' ids:
users = [12, 13, 14, 15]
I'd like to make a function when every time I call it I can change the order of my list:
#function()
users = [13, 14, 15, 12]
#function()
users = [14, 15, 12, 13]
#function()
users = [15, 12, 13, 14]
I looked into Google but I didin't find a good way to do that. I'm thinking in pop the first value and remake the list every time that my function is created and put the poped item in last position. Is there a more pythonic way to do it?