President Donald Trump walks up the steps of Air Force One at Andrews Air Force Base.

This was the week that Trump learned that there is a reality beyond what’s in his head, and that it can bite back. That’s both good news and bad news for the Trump resistance. If he starts behaving more like a normal person, he’s that much more dangerous.

Monday night, Trump’s dumped his national security adviser, Michael Flynn. Even under a president who got famous for bellowing, “You’re fired!”, Flynn was allowed to follow the usual bogus Washington protocol, and “resigned.” It didn’t take Trump long to get with that program.

This followed two days of total disarray around Flynn’s Russia connections, which reminded the public of Trump’s own footsie with Putin. Pushing out Flynn was doubly tricky, since Trump doesn’t know everything that the CIA has on Flynn—or what Flynn has on Trump, should Flynn feel wronged and decide to sing.

Once again, the White House was in full disarray, with Kellyanne Conway and Sean Spicer telling different networks almost at the same moment that Flynn enjoyed Trump’s full confidence (Conway), and that Trump was re-evaluating him (Bannon). In a rare harmonic convergence, both Vice President Pence, to whom Flynn lied, and counselor Steven Bannon, a Flynn-style swaggerer, were pushing for Flynn’s resignation.

Trump eventually went along. So this was the week that this reckless president learned the art of the tactical retreat and the logic of damage control.

After initially doubling down on his assault on the courts (with a tweet, no less), a maneuver all but guaranteed to produce at least six Supreme Court votes against his anti-Muslim executive order, Trump told reporters that he might issue a much narrower order that could withstand constitutional scrutiny.

Trump also learned the virtue of a tactical retreat when it comes to provoking a needless war. After an impulsive embrace of Taiwan and a seeming reversal of America’s long standing acceptance of the principle that there is only one Chinese government, Trump meekly bowed to Chinese pressure and confirmed in a phone call with China’s Xi Jinping that the U.S. respects the One China policy.

Diplomacy with China is nothing if not tricky. It is the last situation on the world that rewards the impulsive gesture. You can just imagine the adults trying to explain the realities to Trump.

Trump beat a further retreat on his blanket support for more Israeli settlements in the occupied territories of the West Bank. This could be more Trump double-speak, of course. The true U.S. policy remains to be seen.

It appears that the grownups in the room are beginning to protect Trump from his own nuttier impulses; and second, that maybe Trump himself is grasping that he wasn’t elected dictator; and that there is a reality outside of his bubble, which constrains his absolute freedom to indulge tantrums. Actions have consequences. Imagine that.

This past week, Trump also found that bluster occasionally pays off. In their national day celebrating the anniversary of their 1979 Islamic Revolution, the Iranian leadership was far more muted than usual in its denunciations of The Great Satan.

Iran has a fragile agreement with the U.S. to protect—lifting of sanctions in exchange for a freeze on development of nuclear weapons—and the regime does not want to make waves with an American president who is a lot crazier than they are. The U.S.-Iran détente, which gives Trump some leverage, is of course to the credit of one Barack Obama, but never mind.

At home, Trump managed to get several of his far-right cabinet nominees confirmed, with no losses. It may well take a reversal of the Senate’s filibuster rule, but Trump is also likely to win confirmation of his Supreme Court nominee, Neil Gorsuch.

And he faced down his own secretary to state, Rex Tillerson, to veto the nomination of the weasely Eliot Abrams to be deputy secretary. This news is also double edged. Abrams was a neo-con super-hawk, convicted of lying to Congress for his role in the Iran-Contra affair and later pardoned by President George H.W. Bush to block further investigations that could have implicated President Reagan.

Abrams was a friend of thuggish dictators. He would have fit all too well into the Trump administration, but for his unpardonable error of having criticized Trump.

The next appointee will probably be worse. But the Abrams affair shows that there are limits to the ability of the grown-ups to contain Trump. He is the decider.

So maybe Trump’s good news isn’t such bad news after all. We can count on more outbursts, more self-destructive acts, and more vicious infighting.

Trump remains in flagrant violation of the Emoluments Clause of the Constitution of because of his profiteering from his conduct of the foreign relations of the United States. The investigations of Trump’s real motivations in his dealings with Vladimir Putin continue, and the Flynn mess doesn’t help.

If ever there were an impeachable offense, selling out the national security for your business interests has to top the list.

Though Republicans in Congress are happy to take the deregulation, the tax cuts, right wing appointees and the government-bashing, they will desert Trump once he becomes sufficiently radioactive. In the meantime, the anti-Trump movement in the country only grows stronger, teaching us all a lesson in what democracy looks like.