Newt Gingrich learned the difference between being a pundit and a candidate this week. Before he announced he was thinking about announcing his candidacy for president, he could opine without fear of contradiction—which is to say, he could contradict himself all he wanted. No one would notice. Now people do. As it turns out, on Libya, he was for a no-fly zone before he was against it.

The former House speaker once said that flip-flopping was a disqualification for office. If that were true, the man he was attacking would not be president. President Obama this week was participating in an even more high-profile reversal than Gingrich’s. As a candidate in 2007, then-Sen. Obama said a president could not unilaterally authorize military action * without Congress’ consent. That’s just what he’s now doing in Libya.

As we lumber toward a campaign year, the flip-flop will become a topic of much conversation. Which candidates have changed their positions, and what does it mean? Are political promises a mere starting point, suggesting how a candidate will behave? Or are they sacrosanct?

All politicians change their positions. But there are different kinds of reversals. Sometimes they can be the product of evolution or circumstance. Other times, candidates do the shimmy because they have no core beliefs. That’s more worrisome than simple political hackery, cases in which a candidate changes his position because doing so will make it easier to attack the other guy. The way we untangle Gingrich’s and Obama’s reversals might help us evaluate the president asking to be re-elected and as calibrate our expectations for the candidates making promises who want to replace him.

Gingrich’s change was politically motivated but unimportant. He holds no office and has a very long climb to the Republican nomination. When he changes his mind, no one is affected. He is a deeply political person and a professional pundit who sees it as his job to wing out ideas that damage the opposition. All that Gingrich has shown us in his reversal is that he is sloppy. In his explanation of his discordant opinions, he has proved only that he has to sharpen his communications skills. We don’t want a president who speaks carelessly, and the transparent point-scoring divides the country and poisons the conversation. At the same time, we’ve forgiven candidates—including the one now in office—when they’ve behaved similarly.

The president’s change is important but not politically motivated. Obama outlined a principle in 2007 about the relationship between the executive and the conduct of war. “The President does not have power under the Constitution to unilaterally authorize a military attack in a situation that does not involve stopping an actual or imminent threat to the nation,” he wrote. As a teacher of constitutional law, he was not offering an idle opinion. As a relatively inexperienced candidate, he was holding forth on one topic on which he could claim expertise. Now that he’s in office, and at a moment his supporters imagined would bring out his firmest convictions, he’s changed his mind. This isn’t just afternoon cable chatter. As a result of his reversal, there are bombs in the air and people in danger.

Obama’s change could serve as an illustration of the temptations of the executive branch. No matter what a presidential candidate says in a campaign, the power of the office is difficult to resist.

But there is another way to explain it: A president should be allowed, and in fact encouraged, to respond to changing circumstances. And sometimes those circumstances will require him to rethink his principles. Perhaps it is the rigidity of the campaign promise that is at fault. And maybe the media and the public need to ask a follow-up question: It’s essential to know a candidate’s principles, but we should also ask about conditions under which he would reconsider them. If a candidate doesn’t offer anything but rigidity, then he is either trying to fool us (shocking), or he doesn’t allow for the fact that the real world is inevitably more complicated than you think.

Obama has shed his old belief because he is dealing with a fast-moving and changing situation in which thousands of lives are at stake. He has a pass to expand on his original views. George W. Bush was unfairly criticized for going back on his campaign pledge that he wouldn’t engage in “nation-building.” That was cheap: The world had changed. Nation-building was important in a country like Afghanistan. It’s possible to believe that and still think the adventure in Iraq was a bad idea, poorly executed.

Obama’s aides argue that what he is well within his constitutional authority. But that’s not the issue. What causes people to question the president is that they’re unclear about the space between his promises and his actions. If you’re going to change your mind, you’ve got to explain why. This is both a responsibility to voters and in your self-interest as a president, because if you say nothing, the worst possible interpretation will fill the vacuum.

The president is scheduled to address the nation on Libya “in the very near future” (probably Monday). Perhaps he will use the occasion to explain why he changed his mind.

Correction, March 26, 2011: The article originally stated that the president could not take unilateral action. What Obama said was that the president could not unilaterally authorize military action. (Return to the corrected sentence.)

Become a fan of John Dickerson on Facebook.