I have a list of objects and I want to shuffle them. I thought I could use the random.shuffle method, but this seems to fail when the list is of objects. Is the
random.shuffle
def shuffle(_list): if not _list == []: import random list2 = [] while _list != []: card = random.choice(_list) _list.remove(card) list2.append(card) while list2 != []: card1 = list2[0] list2.remove(card1) _list.append(card1) return _list