class ref:

    def __init__(self, obj):
        self.obj = obj

def get(self):
    return self.obj

def set(self, obj):
    self.obj = obj
a = ref([1, 2])
b = a
print(a.get())
print(b.get())
b.set(2)
Simulating Pointers in Python