Republicans in N.C. Senate cut education funding — but only in Democratic districts. Really.

This bit of North Carolina news won’t get as much attention as the infamous “bathroom bill,” which insisted that people at public schools and other government-run facilities use bathrooms that correspond to the gender listed on their birth certificate, sparking a boycott of the state. But it is worth noting as a new lesson in how not to drag schools and kids into your legislative skirmishes — and as the latest attack on public education by North Carolina Republicans.

During a budget debate in the state Senate that started Thursday and went into the early hours of Friday, Republicans became annoyed at Democrats who, the Republicans thought, were unnecessarily offering amendments and prolonging the session. According to the News & Observer, Democrats offered five amendments pushing funding priorities, each of which was voted down.

At about 1 a.m. Friday, the Republicans halted the proceedings and went into private talks. At about 3 a.m., they returned, and a Republican senator introduced an amendment of his own.

This amendment proposed $1 million in new funding to fight North Carolina’s opioid epidemic, which has been called the most severe public health issue in the state. That’s an issue that would seem to be bipartisan — but there was a twist.

The money to fund new pilot programs for this cause had to come from somewhere, and the Republicans decided to take it out of education programs in Democratic districts, along with other things the Democrats had wanted.

The News & Observer said a rural district in northeastern North Carolina “took the biggest hit” from the amendment, with $316,646 cut from two early college high schools and the state banned from financially supporting a science, math and technology program that has helped many African American and low-income families.

Here’s another nugget: The amendment stripped seven counties, represented by Democrats, from a program that financially supports teacher assistants working on a college degree.

The amendment was passed shortly after 3 a.m. Surprisingly, two Democratic senators, who apparently hadn’t read the details, voted for it.

Whether these cuts will ultimately stand is unclear, but the episode offers teachers a new example to illustrate to students how not to legislate.

And it stands as the latest in a continuing Republican assault on public education in North Carolina, which in the past five years has included severe budget cuts, the promotion of charter schools and school vouchers without sufficient oversight, and the elimination of due-process rights for many teachers.

Late last year, Republicans passed some bills to weaken the incoming Democratic governor’s power, including one that transferred a lot of power from the State Board of Education — most of whose members are appointed by the governor — to the newly elected state superintendent of public instruction, who, not surprisingly, is a Republican. The governor signed it into law in December. Under the law, the governor will no longer appoint members to the governing board of the University of North Carolina system; the legislature will.