Can we add a destructor to a python part? Or on delete event? Is there a way?