These critiques, however, are off the mark. Over the course of the campaign against Hillary Clinton and now McCain, Obama has elaborated more and more the ideas that would undergird his foreign policy as president. What emerges is a world view that is far from that of a typical liberal, much closer to that of a traditional realist. It is interesting to note that, at least in terms of the historical schools of foreign policy, Obama seems to be the cool conservative and McCain the exuberant idealist.

The rap on Barack Obama, at least in the realm of foreign policy, has been that he is a softheaded idealist who thinks that he can charm America's enemies. John McCain and his campaign, conservative columnists and right-wing bloggers all paint a picture of a liberal dreamer who wishes away the world's dangers. Even President Bush stepped into the fray earlier this year to condemn the Illinois senator's willingness to meet with tyrants as naive. Some commentators have acted as if Obama, touring the Middle East and Europe this week on his first trip abroad since effectively wrapping up the nomination, is in for a rude awakening.

No candidate for the presidency ever claims to have a doctrinal world view. Richard Nixon never said he loved realpolitik. Jimmy Carter never claimed to be a Wilsonian. There's no advantage to getting pigeonholed, and most politicians and even policy folk are clever enough to argue that they want to combine the best of all traditions. So John McCain says he's a "realistic idealist." Former national-security adviser Anthony Lake, who now counsels Obama, calls himself a "pragmatic neo-Wilsonian." Secretary of State Condoleezza Rice describes herself as an "American realist."

Against that backdrop, Obama has been strikingly honest about his inclinations and inspirations. True, he begins by praising Harry Truman's administration, which in the foreign-policy world is a little like saying you admire George Washington. (Bill Clinton, George W. Bush and John McCain have all cited Truman as a model.) But then Obama takes an unusual step, for a Democrat, and praises the administration of George H.W. Bush, one that is often seen as the most hardheaded or coldblooded (depending on your point of view) in recent memory. Obama has done this more than once, most recently in a conversation with me last week on CNN. And he is explicit about what he means. "It's an argument between ideology and foreign-policy realism. I have enormous sympathy for the foreign policy of George H.W. Bush," he told The New York Times's David Brooks in May.

Obama rarely speaks in the moralistic tones of the current Bush administration. He doesn't divide the world into good and evil even when speaking about terrorism. He sees countries and even extremist groups as complex, motivated by power, greed and fear as much as by pure ideology. His interest in diplomacy seems motivated by the sense that one can probe, learn and possibly divide and influence countries and movements precisely because they are not monoliths. When speaking to me about Islamic extremism, for example, he repeatedly emphasized the diversity within the Islamic world, speaking of Arabs, Persians, Africans, Southeast Asians, Shiites and Sunnis, all of whom have their own interests and agendas.

Obama never uses the soaring language of Bush's freedom agenda, preferring instead to talk about enhancing people's economic prospects, civil society and—his key word—"dignity." He rejects Bush's obsession with elections and political rights, and argues that people's aspirations are broader and more basic—including food, shelter, jobs. "Once these aspirations are met," he told The New York Times's James Traub, "it opens up space for the kind of democratic regimes we want." This is a view of democratic development that is slow, organic and incremental, usually held by conservatives.

Obama talks admiringly of men like Dean Acheson, George Kennan and Reinhold Niebuhr, all of whom were imbued with a sense of the limits of idealism and American power to transform the world. "In his view of history, in his respect for tradition, in his skepticism that the world can be changed any way but very, very slowly, Obama is deeply conservative," wrote Larissa MacFarquhar in her profile of him for The New Yorker. "There are moments when he sounds almost Burkean. He distrusts abstractions, generalizations, extrapolations, projections. It's not just that he thinks revolutions are unlikely: he values continuity and stability for their own sake, sometimes even more than he values change for the good."

As important as what Obama says is what he passes up -- a series of obvious cheap shots against Bush. He could bash him for coddling China's dictatorship, urge him to boycott the opening ceremony of the Beijing Olympics or criticize his inaction in Darfur. In fact, Obama has been circumspect on all these issues, neither grandstanding nor overpromising. (This is, alas, not true on trade policy, where he has done both.)

Perhaps the most telling area where Obama has stuck to a focused conception of U.S. national interests is Iraq. Despite the progress in Iraq, despite the possibility of establishing a democracy in the heart of the Arab world, Obama's position is steely -- Iraq is a distraction, and the sooner America can reduce its exposure there, the better. I actually wish he were somewhat more sympathetic to the notion that a democratic Iraq would play a positive role in the struggle against Islamic extremism. But his view is certainly focused on America's core security interests and is recognizably realist. Walter Lippmann and George Kennan made similar arguments about Vietnam from the mid-1960s onward.

Ironically, the Republicans now seem to be the foreign-policy idealists, labeling countries as either good or evil, refusing to deal with nasty regimes, fixating on spreading democracy throughout the world and refusing to think in more historical and complex ways. "I don't do nuance," George W. Bush told many visitors to the White House in the years after 9/11. John McCain has had his differences with Bush, but not on this broad thrust of policy. Indeed it is McCain, the Republican, who has put forward some fanciful plans, arguing that America should establish a "League of Democracies," expel Russia from the Group of Eight industrialized countries and exclude China from both groups as well.

Obama's response to McCain's proposals on Russia and China could have been drafted by Henry Kissinger or Brent Scowcroft. We need to cooperate with both countries in order to solve significant global problems, he told me last week, citing nuclear-proliferation issues with Russia and economic ones with China. The distinction between Obama and McCain on this point is important. The single largest strategic challenge facing the United States in the decades ahead is to draw in the world's new rising powers and make them stakeholders in the global economic and political order. Russia and China will be the hardest because they are large and have different political systems and ideological approaches to the world. Yet the benefits of having them inside the tent are obvious. Without some degree of great-power cooperation, global peace and stability becomes a far more fragile prospect.

Obama and McCain are obviously mixtures of both realism and idealism. American statesmen have always sought to combine the two in some fashion, and they are right to do so. A foreign policy that is impractical will fail and one that lacks ideals is unworthy of the United States. But the balance that each leader establishes is always different, and my main point is that Obama seems -- unusually for a modern-day Democrat -- highly respectful of the realist tradition. And McCain, to an extent unusual for a traditional Republican, sees the world in moralistic terms.

In the end, the difference between Obama and McCain might come down to something beyond ideology -- temperament. McCain is a pessimist about the world, seeing it as a dark, dangerous place where, without the constant and vigorous application of American force, evil will triumph. Obama sees a world that is in many ways going our way. As nations develop, they become more modern and enmeshed in the international economic and political system. To him, countries like Iran and North Korea are holdouts against the tide of history. America's job is to push these progressive forces forward, using soft power more than hard, and to try to get the world's major powers to solve the world's major problems. Call him an Optimistic Realist, or a Realistic Optimist. But don't call him naive.