The last week of the legislative session always is a wild ride, but this year’s proceedings take on an urgency that we haven’t seen in the past several years given the stridently more progressive tilt of the state government.

It’s reminiscent of my favorite scene from Seinfeld, when George Costanza pretends he’s signing papers on a house in the Hamptons. He vows to drive to the new house with the parents of his late fiancée, who know there is no such house. “All right, you wanna get nuts? Come on,” he says as they jump in the car. “Let’s get nuts!”

Boy, is California getting nuts.

On Wednesday, the Legislature passed Assembly Bill 5, which poses an existential threat to the very gig economy that Democrats tout as the heart and soul of California’s economy. It’s a union-crafted disaster that codifies the state Supreme Court’s Dynamex decision from last year. In that bout of judicial activism, justices imposed an “ABC Test” for companies that want to use contractors or freelancers as their workforce.

Those companies can only use contractors if the worker a) doesn’t take direction from the company; b) is involved in work that is not related to the company’s core mission; and c) has established some sort of independent operation, such as an LLC. In other words, Uber and Lyft can hire an independent contractor to, say, do some electrical work in their headquarters or repair their vehicles, but not to work as drivers. There’s no way around that test.

Professional and trade groups with the most political clout have been able to carve out exemptions for their particular industries. It won’t apply to doctors, insurance agents, tow-truck drivers, Realtors, et cetera. But some old-line companies haven’t been able to carve out exemptions. That includes newspapers, which rely on contractors to deliver the papers (although they secured a last-minute delay in implementation). Most significantly, it doesn’t exempt gig-economy transportation network companies.

That means labor costs for new-economy businesses will soar 20 percent or more. A recent Beacon Economics study found that Lyft alone will need 300,000 fewer drivers under certain plausible scenarios. As I argued in the Orange County Register, “The study confirms what other studies have pointed out: The overwhelming number of drivers (95 percent, in this survey) say their flexible work schedules are ‘extremely important’ or ‘very important.’ ” In order to help workers, Democrats may destroy their jobs — or their flexibility.

If it is signed into law as expected, the only recourse — other than getting prepared to give up (or pay far more for) ride-sharing and home-delivery services — is for Uber, Lyft, and DoorDash to follow through with their plans to spend $90 million on a referendum to overturn it.

Speaking of crazy, the Legislature passed a bill that will provide a form of statewide rent control. Assembly Bill 1482 is pitched as an anti-rent-gouging measure, but it is de facto rent control. It would cap rent increases (on homes 15 years or older) at 5 percent a year plus inflation in cities that don’t already have rent-control provisions. It also requires evictions to have a “just cause.” The governor recently announced his support for it.

Aside from pushing localities to permit more high-density housing and boosting taxpayer funding for low-income housing projects, the state has ignored the real causes of California’s ongoing housing crisis. Local governments impose ridiculous permitting costs on housing construction. Reports suggest that 40 percent of the price of a new home may be attributed to regulations and fees. The California Environmental Quality Act (CEQA) delays projects, often for decades, because it makes it so easy for opponents to file lawsuits to stop them.

Instead of addressing the supply problem, California’s progressives are embracing an approach that will depress supply. Rent control has been a nightmare wherever it has been tried, because it discourages new building, encourages landlords to exit the business and neglect maintenance, and entices developers to convert buildings into condos. As the Swedish economist Assar Lindbeck famously wrote, “In many cases rent control appears to be the most efficient technique presently known to destroy a city — except for bombing.”

And for a real sense of this year’s legislative priorities, consider Senate Bill 419, which the governor already signed into law. It forbids public and charter schools from suspending students (through eighth grade) for willfully defying school authorities.

“An overwhelming body of research confirms that suspending students at any age fails to improve student behavior and greatly increases the likelihood that the student will fail, be pushed out of school, and/or have contact with the juvenile justice system,” according to the bill’s author, Sen. Nancy Skinner (D-Berkeley). Perhaps that’s so, but what about the students who remain in the classroom and are trying to, you know, actually learn something while these other students disrupt things?

California’s public schools already are a mess, thanks largely to union work rules that make it impossible to get rid of poor-performing teachers or embrace meaningful educational reforms. This approach — as well as the Legislature’s ongoing attacks on charter schools — will make things worse.

This week’s wild ride surely is a precursor to even scarier times ahead.