For the custard: In a small saucepan, combine sugar, flour and a pinch of salt. Stir in milk, a little at a time, until smooth. Bring to the boil over medium heat, stirring constantly. Boil 60 seconds, then pour a small amount of hot liquid into the 2 beaten egg yolks and stir. Return heated egg yolks to saucepan and stir, over heat, until mixture starts to bubble again. Remove from heat and add vanilla. Cover and chill in refrigerator.
Preheat oven to 230 C / Gas mark 8.
For the choux pastry: In a medium saucepan, combine butter and water and bring to the boil. Sift together flour and a pinch of salt and pour all at once into boiling mixture. Stir vigorously until mixture forms a ball. Remove from heat and add eggs, one at a time, stirring vigorously after each addition. Drop by spoonfuls onto baking tray, or pipe into desired shape.
Bake 10 minutes in the preheated oven, then reduce heat to 200 C / Gas mark 6 and bake 25 minutes more, or until golden. Cool completely, split, fill with custard and replace tops.