Politicians have to modify their stances somewhat, depending on the circumstances. On the other hand, you can be a "purist" who never has a nuanced position and garner 1% in the polls. I'm not saying a candidate should not have core values that never change, but as one political strategist said recently, you can get 100% of the vote of a bloc of voters who represent 25% of the electorate and still lose by a landslide.
AND, then you do.