magic.patch API [rev. unknown]

def patch(namespace, name, value):

rebind the 'name' on the 'namespace' to the 'value', possibly and remember the original value. Multiple invocations to the same namespace/name pair will remember a list of old values.