Put the pumpkin into a pan with the sugar and 1 cm (1, inch) of water, cover and simmer for about half an hour with the lid on, until it is quite soft, dry and almost a purée. Stir until smooth and then blend in the grated cheese, flour and beaten eggs. Season.
Butter a gratin dish and spoon the purée into it. Dot the top with butter and put into a moderate oven (180°C, 350°F, Gas Mark