More work on the python generator