Update to Python generator