Sen. Dianne Feinstein brought the wrath of progressives on herself when she said people should have “some patience” with President Donald Trump.

“This man is going to be president, most likely, for the rest of this term,” Feinstein said during an Aug. 29 appearance at the Commonwealth Club in San Francisco. “I just hope he has the ability to learn and to change. And if he does, he can be a good president. And that’s my hope.”

Ability to change? That’s doubtful. A good president? Not likely.

But president he is, and Democrats in Congress won’t get much done if they don’t engage with him. That was Feinstein’s larger point. And she was right, as House Minority Leader Nancy Pelosi and Senate Minority Leader Charles Schumer demonstrated this past week.

Pelosi and Schumer haven’t had much luck dealing with their Republican counterparts on Capitol Hill, but they hammered out an agreement with Trump to raise the debt ceiling, fund the federal government for three months and double the relief package for victims of Hurricanes Harvey and Irma.

Despite a raft of objections from the far right, Republican lawmakers fell in line, ending at least temporarily the threat of another government shutdown and an unprecedented default.

Keeping the doors open and paying the bills are modest accomplishments, barely worthy of a “C” grade. They are, however, a welcome respite from the zero-sum politics that puts partisan purity ahead of anything else.

We harbor no illusions. Trump is mercurial, narcissistic, at times dishonest, and, as his putative Republican allies in Congress have learned, he’s loyal primarily to himself. But he fancies himself the master of the deal, and, despite attacking Pelosi and Schumer in a new ad, he says he wants to strike more of them with Democrats. They should negotiate. Congress could use a few achievements to burnish its reputation.

Passing a permanent extension of the Deferred Action for Child Arrivals program would be a good start.

Trump obviously wants to get out from under his campaign promise to end DACA, the Obama administration program that protects non-citizens brought to the U.S. as young children from deportation. Should Democrats resist? If they make a deal, should they be punished? Even if it accomplishes a Democratic goal?

California just witnessed an example of swift reprisal for bipartisan cooperation. Republicans in the state Assembly pushed their leader aside because he worked with Gov. Jerry Brown and legislative Democrats to extend cap-and-trade, a market-based mechanism for combating climate change that was endorsed by the state Chamber of Commerce, major manufacturers and other GOP allies.

The Republicans’ message, expressed bluntly, is this: If Democrats are one side, take the other side — or else.

Some Democrats adopted the same stance after hearing Feinstein’s remarks. They want to punish her — not for voting against party principles (she hasn’t) or supporting Trump (she hasn’t done that either) but for opposing knee-jerk resistance to the president. It was wrong when Republicans did that with Barack Obama, and it’s wrong now.