The joke is a pun on the word 'pi'.  Pi is a number used in calculated radius and circumference of spheres and circles.  Pi sounds like 'pie' which is a dessert food that can be made with all kinds of flavors such as pumpkin.
A perfectly spherical pumpkin makes good pi .