Last year, after President-elect Trump picked Jeff Sessions to be attorney general, The New York Times editorial page called the Alabama senator “radical” and “extreme” and tarred him as an unrepentant racist and xenophobe.

Last week, after Trump criticized Sessions and others, the same editorial page suddenly discovered a new fondness for Sessions. The Times now insisted that Trump had impugned his “integrity” and that of others “who have spent their careers respecting and protecting” the law.

It’s not likely that Sessions is grateful for the embrace. He knows he’s just a pawn — dirt when Trump embraces him, and a saint when Trump criticizes him.

Media hypocrisy doesn’t get any more blatant.

Unfortunately, what’s past is prelude to the coming battles. The president, shuffling the deck of his team in preparation for a showdown with special counsel Robert Mueller, made a big move in naming Anthony Scaramucci his new communications director, leading press secretary Sean Spicer to resign.

Scaramucci, a successful hedge-funder whose soft speaking style belies a passionate core, had a solid debut Friday. I trust he ­enjoyed his one-day honeymoon with the White House press corps.

Starting now, he’ll need a long fuse and an appreciation for the ridiculous if he hopes to fix the president’s relationship with reporters. Reputations and facts are expendable in their race to bring down the president.

Yet it’s also true that to succeed, Scaramucci must keep his boss on message. Trump’s tweet storm Saturday morning about various topics is a good example of a bad habit — it does little to advance the repeal of ObamaCare, tax ­reform and job creation.

Instead, the president’s eruption is the news, making it easy for the press to ignore for another day the substantive topics that matter to most people.

The Sessions coverage offers other lessons about the mountain Scaramucci faces. The president is on solid ground when he ­laments making Sessions his AG, though the get-Trump media will never admit it. To them, Sessions is suddenly a victim of Trump and a hero for refusing to quit.

In fact, Sessions is neither. As I wrote in June, Sessions is the biggest mistake Trump made because it led to the appointment of Mueller and an investigation that is going far beyond its original scope of whether the Trump campaign colluded with Russia last year.

Mueller is now said to be looking at Trump’s business, going back years, in a scavenger hunt for Russian connections. Donald Trump Jr. and Jared Kushner, the president’s son-in-law, have been summoned by Congress, and probably will be called by Mueller.

In other words, Trump’s family and his company — in addition to his presidency — are being put through the wringer of a criminal case even though there is no known crime.

Jeff Sessions helped to set that disaster in motion.

Soon after being confirmed for AG, he recused himself from anything involving the 2016 campaign, despite the president’s opposition. More shocking, Sessions later told Congress he knew he would have to recuse himself from day one because of Justice Department regulations.

Trump fumed privately about the recusal, but his public statements last week got to the heart of the matter. “Sessions should have never recused himself, and if he was going to recuse himself, he should have told me before he took the job and I would have picked somebody else,” Trump told the Times.

It is an entirely reasonable position, given what followed. Rod Rosenstein, a career prosecutor selected as the deputy AG, became acting attorney general for the Russia probe and soon appointed Mueller as special counsel after the firing of FBI Director James Comey.

In another tangle, Rosenstein wrote a compelling memo urging Comey’s dismissal, and because of that memo, Rosenstein has suggested he, too, might have to recuse himself from overseeing Mueller.

The result is that Mueller already is effectively unsupervised, and free to do pretty much whatever he wants for as long as he wants. No president, nor any other American, should be subject to an unrestrained prosecutor.

Meanwhile, more leaks of supposedly secret information about the investigation are emerging. A report Friday, predictably attributed to anonymous sources, said Mueller directed the White House to preserve notes that relate to the June 2016 meeting Donald Trump Jr. had with a Russian lawyer and others.

The current course is a potential disaster not just for the president, but for the nation. Democrats and the left-wing journalists who never reconciled themselves to Trump’s victory now see Mueller as their political avenger, and he seems to be accepting the role with relish, voters be damned.

Trump is nobody’s punching bag, and his staff changes and public complaints about Sessions, Mueller and Rosenstein show he is ready to fight back. He is also reportedly gathering information about conflicts of interest on Mueller’s team, a sign that he sees this as a battle for survival.

On that point at least, there can be no disagreement.

Cuo, Blas in blame shame

That was fast.

A few days after Gov. Cuomo and Mayor de Blasio claimed to be uniting to fight federal changes to ObamaCare, they were back to their normal stance — fighting each other.

With subway service in a death spiral, the governor and mayor are trying to pin the blame, and the cost, on each other. On a less important topic, their ducking, dodging and finger-pointing would be comical.

But there is nothing funny about what’s happening to transportation in New York. It’s grinding to a halt, above and below ground.

Beyond their personal animus, Cuomo and de Blasio know that gobs of money won’t bring quick fixes. And with both facing re-election — de Blasio this year, Cuomo next — they find it politically convenient to blame each other rather than get stuck with the responsibility for a job that can’t yield instant results.

New Yorkers deserve better, but won’t get it until they hold the pols accountable. Failure must have consequences.

Pass up this ‘deal’

A report says Democrats plan to rebrand themselves as the Better Deal party.

Better than what? Better than Republicans, or better than what Hillary Clinton was selling?

Better they get another idea.

Mutual badmiration

Describing an audit of just eight public schools and one administrative office that revealed thousands of laptops and tablets worth up to $2,000 each were missing, City Comptroller Scott Stringer was smoking.

“The bureaucracy is malfunctioning in mind-boggling ways,” he said, adding that at least “35 percent of approximately 14,000 machines were not properly accounted for.”

Noting a similar audit two years ago, he said, “The situation has only gotten worse.”

And, “As this audit once again shows, taxpayer dollars are exposed to waste, fraud and abuse — and it’s coming at our kids’ expense.”

Strong stuff — but those schools are run by Mayor de Blasio, and Stringer made his charges four days after he and de Blasio, both Democrats, endorsed each other for re-election.

Such is government in a one-party town.