compiler. Refactored the python generator, #242, fixed #196.