Issue when porting an example sketch from the Hemesh library to Python mode

Thanks a ton for the comprehensive explanation.