python: add modify_itself python code