Working gen_python, slightly-simplified API for now