Cut off and discard the stem of the pumpkin. Split the pumpkin in half and scoop out and discard the seeds and inner fibers. Cut the pumpkin into eighths. Cut off and discard the tough skin. Cut the pumpkin meat into 1-inch cubes. Set aside.
Heat the butter in a saucepan and add the onion. Cook until wilted and sprinkle with flour, stirring with a whisk. When blended, add the stock, stirring rapidly with the whisk. When blended and smooth, add the pumpkin. Simmer about 30 minutes, or until the pumpkin is quite tender.
Purée the soup in the container of a food processor or blender or put it through a food mill. Return the purée to the saucepan. Add the sugar and cream and bring just to the boil. Serve piping hot.