In this paper we study optimal choices of self-selection into politics and commitment once in office on the part of citizens with heterogeneous abilities and heterogeneous motivations. Politicians can moonlight, i.e., they can work in the market sector while appointed in parliament. Our theoretical framework shows that high-ability citizens may enter politics. Yet while high-ability non-motivated (market-fit) politicians are likely to shirk, high-ability motivated (public-fit) ones are more committed to parliamentary activity. We test our predictions by using a unique database of Italian parliamentarians for the period 1996-2006. We find evidence of advantageous selection of the market-fit and the public-fit politicians in that they both display a pre-election income greater than that of the Italian population. We also show that the commitment of the market-fit parliamentarians in terms of voting attendance is negatively affected by income opportunities, whilst this is not the case for the public-fit ones.