Preheat the oven to 200C/180C Fan/Gas 6. Prick the potatoes all over with a fork and place in a roasting tin. Add the pumpkin (or squash) and bake for between an hour and an hour and half until both pumpkin and potato are tender.
Remove from the oven. As soon as they are cool enough to handle with a tea towel – and you want them still hot, as you shouldn’t mash when cool – peel the skins from the potatoes and pumpkin (or squash). Put the potatoes through a ricer into a bowl.
Put the pumpkin through a ricer too, but into a saucepan. Drain off any water that comes out of the squash when you rice it, then cook in the saucepan, stirring constantly, until it feels much drier. Remove from the heat.
Put the pumpkin and potato onto a lightly floured work surface and sprinkle 150g/5½oz flour on top, along with plenty of salt and pepper, and the parmesan.
Make a little well in the middle and add the egg. Mix everything together with your hands, trying to keep the working to an absolute minimum (overworking makes the dough tough). If it is still sticky, add a little more flour. You can get away with it being slightly sticky – better this than doughy.
Divide the dough into six pieces. Roll each piece of dough into a sausage shape, around 15mm/⅝in in diameter, then cut off lengths around the same size. Repeat until you have used all the dough. Mark with fork prongs if you like.
Bring a large saucepan of water to the boil and add plenty of salt. Cook the gnocchi in batches – they will initially sink, then float. When they rise to the top, cook for a further two minutes, before removing with a slotted spoon.
To serve, melt the butter in a large frying pan. Add the sage leaves and fry for 30 seconds. Add all the gnocchi and cook for another minute or two, shaking the pan around so they very lightly brown in the butter.
Add the spinach and wilt it down around the gnocchi. Transfer to a large serving platter or individual bowls and serve with lots of grated parmesan.