Former president Barack Obama said Saturday that he is concerned about “rigidity” among some liberal Democrats who take aim at others in the party for “straying from purity on the issues.”

His remarks come amid an internal debate in the party over the most effective path to take in challenging President Trump for the White House in 2020. Democrats recaptured the House in November in large part due to a surge of liberal energy. But as some have embraced sweeping proposals such as Medicare-for-all and the Green New Deal plan to combat climate change, others have balked, arguing that the party should take a more centrist approach.

At a town-hall-style event hosted by the Obama Foundation in Berlin, the former president was asked about the art of compromise.

He told the crowd of mostly young people that, in politics as well as in the civic arena, “you have to recognize that the way we’ve structured democracy requires you to take into account people who don’t agree with you.”

“One of the things I do worry about sometimes among progressives in the United States — maybe it’s true here as well — is a certain kind of rigidity, where we say, ‘Oh, I’m sorry. This is how it’s going to be,’” Obama said.

He lamented that Democrats sometimes create “what’s called a ‘circular firing squad,’ where you start shooting at your allies because one of them is straying from purity on the issues.”

“When that happens, typically the overall effort and movement weakens. . . . You can’t set up a system in which you don’t compromise on anything. But you also can’t operate in a system where you compromise on everything; everything’s up for grabs. That requires a certain amount of internal reflection and deliberations,” he said.

Obama told the crowd that, while his signature domestic achievement — the 2010 Affordable Care Act — did not contain everything he wanted, he viewed its passage as a success.

“That was not the ideal health-care program that I wanted to set up. It’s what I could get at the time, and if I could establish the principle that everybody gets health care and get 20 million people more health care — even if 10 million still hadn’t gotten it — that’s what I’m going to do now,” he said.