Add instance management callback to python bindings.