One positive thing could come out of the fiasco of the sentencing hearing for Gen. Michael Flynn — a national teaching moment in respect of the meaning of “treason.”

We seem to be hearing this word more and more. My favorite example was a New York Times headline over a column about President Trump’s dealings with Vladimir Putin: “Trump, Treasonous Traitor.”

It’s not just liberals, though. A year ago, one-time Trump assistant Sebastian Gorka was on Fox News suggesting that Hillary Clinton should be brought up for treason.

I don’t wish to put the gloss on Flynn. What a former head of the Defense Intelligence Agency was thinking when he hired himself out to Recep Tayyip Erdogan’s Turkey is beyond me. As is his thinking when he took a fat fee to give a speech at a banquet in Moscow, where he sat next to Putin.

Sleazy as they are, neither act gets anywhere near the constitutional meaning of treason, which is levying war against the United States or adhering to our enemies, giving them aid and comfort.

Speaking at a banquet of a rival like Russia, however ill it means us, or serving as an agent of a lousy “ally” like Turkey, doesn’t cut it. Which is why what happened at Tuesday’s hearing was so shocking.

The hearing was set by a US district judge, Emmet Sullivan, to sentence the general. He had pleaded guilty to a single count of lying to the FBI about what he said to the Russian ambassador in late 2016.

There was nothing wrong in what he said to the ambassador. He was doing what the president-elect, Trump, wanted. But he was lured into an FBI interview without a lawyer.

So the judge asked if Flynn wanted to withdraw his plea. He also pressed him on whether he felt the FBI had violated his rights. Flynn’s lawyer answered no.

This reminds me of a Ronald Reagan joke about the fellow who, after he, his horse and dog had been injured in an accident, told the cop that he never felt better in his life.

Turns out that first the officer had shot the injured horse to put it out of its misery and proceeded to shoot the dog for the same reason. Only then did the officer ask the injured man, “And how do you feel?”

Of course Flynn wasn’t going to tell the judge he was unhappy with his plea. That would only expose the general to renewed attacks by the special prosecutor.

The judge started denouncing Flynn’s work for Turkey. “You were an unregistered agent of a foreign country while serving as the national security adviser to the president!” Sullivan yelled.

Yet Flynn had ceased his work for Turkey two months before he became National Security Advisor. That blunder, though, was nothing compared to the judge’s question on treason.

Suddenly the judge asked the prosecutors about the possibility of any “treasonous” activity by Flynn, given President Barack Obama’s sanctions on Russia for meddling in our election.

Even the prosecution was flabbergasted. For treason is one of the brightest lines in American law. By placing the definition of treason right in the Constitution, the Founders specifically blocked judges or Congress from tinkering with the meaning.

They also said that no person shall be convicted of treason except on the testimony of two witness. And it had to be an “overt” act. Plus, the Constitution forbids convicting someone on a confession unless it is made in open court.

The prosecutors assured the judge that the government doesn’t suspect Flynn of treason. After a break in the hearing, Sullivan apologized for falsely claiming Flynn’s work for Turkey took place while he was National Security Advisor.

“I felt terrible about that,” the judge ­reportedly said. He also walked back his treason question, saying that “there are a lot of conspiracy theorists out there.”

No kidding. One just doesn’t expect to encounter them wearing judicial robes in federal court, speculating about treason while a man’s freedom is at stake.

Superlawyer Alan Dershowitz is suggesting that Sullivan’s statements “reflect a kind of abiding bias that might well result in reversible error” if Flynn’s lawyers ­appeal Sullivan’s eventual sentence.

Then again, Flynn’s plea agreement says he has given up his right to appeal. Meanwhile, here’s hoping Judge Sullivan’s outburst will encourage Americans to stop willy-nilly calling fellow citizens traitors.