Arizona Sen. John McCain was diagnosed with brain cancer this week, his office announced on Wednesday. He has a brain tumor called a glioblastoma and is now in Arizona, recovering from a surgery to remove a blood clot above his left eye. It is not immediately clear whether McCain will return to the Senate in the next few days or weeks or if his absence will be longer. FiveThirtyEight wishes McCain and his family the best in his recovery.

McCain is a well-respected figure in both parties, which led to an outpouring of well-wishers that included both and President Trump and former President Obama. He is also a landmark figure in American politics — and has at times been both an ally and opponent of Trump — so we thought it was important to look at McCain and his potential absence in that context.

McCain, 80, has often been described — and has sometimes described himself — as a “maverick.” But as we discussed in February, the truth is somewhat more complicated, with McCain having gone through various phases since he was first elected to the Senate in 1986.

After having been a fairly typical Republican for his first dozen or so years in the Senate, McCain ran to the left of front-runner and eventual nominee George W. Bush in his 2000 presidential bid. He made campaign finance reform one of the central themes of his candidacy. In the run-up to his 2000 candidacy, he often sided with moderates or liberals on key votes, as can be seen in how often McCain differed from the conservative position on the American Conservative Union scorecard:

Disenchanted with the Bush presidency, McCain flirted in 2004 with joining the ticket of Democratic nominee John Kerry. But in 2007, on the eve of his next presidential run, McCain became one of the leading advocates of increasing the number of troops in Iraq, which was a much more popular idea on the right than the left. Again showing his ideological flexibility as the GOP’s 2008 presidential nominee, McCain considering picking Connecticut senator and former Democrat Joe Lieberman as his running mate, who supported hawkish national security policies like McCain but also backed abortion rights and held many other liberal views. But instead McCain opted for Sarah Palin, who was strongly against abortion rights and beloved by the conservative base.

In the Obama years, McCain voted with Republicans on the big issues, such as opposing the Affordable Care Act. Yet, he worked with Democrats on a 2013 bill that would have granted citizenship to undocumented immigrants. And at the end of last year’s presidential campaign, he declared that he would not support Donald Trump. (Earlier in the campaign, Trump had mocked McCain’s war record, saying, “He’s not a war hero. He’s a war hero because he was captured. I like people who weren’t captured.”)

So is McCain a flip-flopper — or an opportunist? Neither, really; instead, he’s been fairly consistent. For most of his tenure in office, McCain has not shifted his legislative philosophy so much as the rest of Congress has shifted — and become more partisan and ideological — around him. Although McCain voted with Republicans about the same amount in both periods, he went from being slightly more partisan than most senators between 1987 and 1996 to among the least partisan senators in the years since then because party-line voting increased so much during that period.

McCain is probably best understood not through a label like “maverick,” but instead through his actual positions. He is consistently pro-military, pro-intervention and hawkish on national security issues, from Iraq to Russia to North Korea. He is also most passionate about those matters, leaving writing bills on issues such as abortion or tax reform largely to his colleagues. On domestic policy, McCain can be all over the place; for example favoring a path to citizenship for undocumented immigrants at times but other times saying he opposes that idea.

How all of this has played out in the era of Trump is complicated. McCain has voted with Trump’s position 90.5 percent of the time, according to FiveThirtyEight’s Trump Score. Still, in such a highly partisan epoch, only two Republican senators — Maine’s Susan Collins and Kentucky’s Rand Paul — have voted with Trump less often this year.

And as time has gone on, McCain has come to be more critical of the president. After almost always voting with Trump from January to April, he has voted against Trump’s position on three of the last four Senate votes in which the White House has taken a clear stance. He was one of the strongest voices in the Senate in the chamber’s June decision, by a 97-2 vote, to add new sanctions against Russia and require congressional approval to lift existing ones, an idea that the Trump administration opposed.

McCain has built relationships with figures like Defense Secretary Jim Mattis, who is trying to steer Trump toward more traditional foreign policy stands. And from the beginning of Trump’s tenure, McCain’s been taking trips abroad and telling anyone who will listen that the president’s comments about Muslims and other controversial stances are not representative of all Americans. It is hard to think of that many other examples of U.S. senators repeatedly questioning the president of their own party while travelling overseas.

McCain has not just differed from the president on foreign policy. The Arizona senator has called for the creation of a special congressional committee to investigate Trump’s ties to Russia, along the lines of what has created in the Nixon era to probe Watergate. He has also urged reporters to keep pushing for details on the Trump-Russia issue. When news emerged recently about a meeting between Donald Trump Jr. and Russian figures, McCain pointedly said, “I guarantee you there will be more shoes to drop, I can just guarantee it.”

McCain’s critics on the center and the left have more room to be critical about his positions on domestic policy. He is unquestionably establishment-friendly and media-friendly, making constant appearances on Sunday morning talk shows, which often makes him seem more liberal than his actual record. Historically, he’s been quite conservative on economic policy. And while at times McCain has been sarcastic and pessimistic in his assessment of the Republicans’ health care bill — criticizing Republicans’ secrecy in drafting it and recently suggesting that the GOP work on a bipartisan bill — he’s been slow to articulate his own position on the legislation, although a statement he issued last week suggested the bill needed significant revisions.

Still, even if they have taken the same stances on most issues for the last six months, John McCain is a very different kind of Republican than Donald Trump, He’s been one of the leading figures of a group of senators that includes Nebraska’s Ben Sasse, Arizona’s Jeff Flake, South Carolina’s Lindsey Graham and others. These senators are not moderate or anti-Trump, at least according to their voting records. But they are different from the president in style and tone and are willing to criticize the White House on some issues. Unlike Trump, they can also be gracious and conciliatory toward their political opponents. In 2008, when rank-and-file Republican voters at his events spoke negatively about Obama’s character and background (falsely suggesting that Obama was an “Arab”, for example), McCain defended his Democratic rival and urged a focus on policy differences. He declined to pointedly attack Obama’s relationship with the controversial pastor Rev. Jeremiah Wright

So if you are Donald Trump, the absence of McCain is complicated. His absence from the Senate will make it even harder for Republicans to pass health care, as he’s backed Trump’s agenda most of the time. But he’s been a loud and proud critic of Trump when he opposed him — and he’s been opposing Trump more often in recent weeks.