It made no sense when Barack Obama left the country on his nine-day overseas tour for some of my fellow columnists to describe it as a high-risk venture.
Foreign leaders, who can read the polls as well as anyone, would go out of their way not to embarrass a man who may, six months from now, be president of the United States.
Obama prepares thoroughly for the big occasions. He is almost always well briefed, and he was traveling in sharp company with Sens. Jack Reed and Chuck Hagel so you knew he would be ready for these meetings. The chance of a major screw-up was minimal.
And as millions of Americans who watched the primary campaign learned, Obama is invariably articulate. There would be no verbal gaffes.
So where was the risk? It existed mainly in the minds of some journalists and, perhaps, in the musings of Obama staffers who wanted to hype the journey.
Acknowledging all that, it is still the case that Obama is pulling off this trip in great style and thereby has enhanced his Oval Office credentials.
What he could not have counted on is the role that luck has played in the events that have surrounded the tour and in the actions of a cast of supporting players. When, on the first day of the trip, Obama stepped onto a basketball court at the air base in Kuwait and sent his first three-point shot cleanly through the basket, you knew that the gods had decided to favor him.
He could not have known in advance that on the very day he left Chicago, President Bush would suddenly reverse six years of policy and send a high-ranking State Department official off to a meeting with Iranian and European nuclear negotiators.
He could not have guessed that Iraqi Prime Minister Nouri al-Maliki, eager to promise his constituents that the American occupation would not be endless, would persuade Bush to declare agreement to "a time horizon" for the departure of U.S. troops.
And he could not have assumed that a Maliki spokesman, briefing reporters on the prime minister's meeting with Obama, would volunteer the comment that "the end of 2010 is the appropriate time for the withdrawal" of U.S. troops.
Suddenly, long-standing Obama policies direct talks with Iran and a 16-month timetable for withdrawal seemed to be ratified by events.
So it was a confident and contented Obama who faced reporters Tuesday in Jordan for his first news conference of the trip. He handled the expected question about his meeting with Gen. David Petraeus by saying he perfectly understood the U.S. commander's opposition to any timetable that would limit his options, but that as commander in chief, he, Obama, would weigh Iraq's needs against those in Afghanistan and also against the interests of the domestic economy.
It was a skillful answer, not rejecting Petraeus's views but asserting a president's own larger responsibility.
On the other hand, his saying that there was no way to know what would have happened in Iraq if the United States had followed his advice to start the withdrawal of troops two years ago rather than embarking on the "surge" seemed disingenuous. Obama still has trouble admitting when he is wrong.
But his troubles are minimal compared with those of John McCain, who looks like the odd man out in the ongoing foreign policy debate. Having given steadfast support to the policies of both Maliki and George Bush, he has a legitimate complaint: They owed him more consideration in the way they announced their shifts. As it is, McCain appears isolated from trends in both Baghdad and Washington.
McCain's frustration at the turn of events is something he cannot conceal. The domestic economy was always going to be a problem for him even before gasoline hit $4 a gallon. But he had a credible position to argue on national security issues and a record that was consistent and in some respects prescient.
But now the ground has shifted and his opponent was right where he needed to be to capture the advantage. July has been a cruel month for McCain.