'Register an object with a StackedObjectProxy'

def register(self, stacked, obj):

    myreglist = self.reglist[(-1)]
    stacked_id = id(stacked)
    if (stacked_id in myreglist):
        stacked._pop_object(myreglist[stacked_id][1])
        del myreglist[stacked_id]
    stacked._push_object(obj)
    myreglist[stacked_id] = (stacked, obj)
