Great news for potheads, at least those in — you knew it — San Francisco.

The district attorney there, a man named George Gascon, has decided he is going to apply California’s marijuana legalization law retroactively. That means thousands of misdemeanor and felony marijuana convictions going back for decades will be erased or reduced.

“We believe it is the right thing to do,” said Gascon. “We believe it is the just thing to do.”

Back in November of 2016, California voters okayed the use of recreational marijuana for those 21 and older and possession up to one ounce.

But the measure also permits those with previous marijuana convictions that would have been no crime at all under the new law, or a lesser charge, to petition courts to dismiss their old cases.

Gascon noted that such petitions involve time and attorney fees, so he’s going to wipe them all out en masse. This will erase the criminal records of many, which could help in job-seeking.

“We’re hoping what we are doing here will not only benefit San Francisco,” said the district attorney. “We’re hoping other elected officials around the state will say this is the right thing to do.”

If Gascon’s name sounds familiar, it should. He was the prosecutor in the murder trial of Jose Ines Garcia Zarate, the oft-deported, illegal immigrant accused of murdering Kate Steinle. The man was acquitted of both murder and manslaughter.

Political observers in San Francisco say Gascon’s reelection next year is now uncertain, not because he botched the trial and the man got off scot-free. But because Gascon over-charged the man and should have left off the murder charge.