In My code random.shuffle works, here's an example regarding that:
from random import shuffle
x = [[i] for i in range(10)]
shuffle(x)
print x
You should also keep this thing in mind that shuffle does not return any value
For your code, you just need to replace some line of code which I am doing down here:-
import random
class a:
foo = "bar"
a1= a()
a2= a()
b = [a1,a2]
random.shuffle(b)
print(b)