Chief Justice John G. Roberts Jr. arrives for the swearing-in ceremony of Judge Neil M. Gorsuch, the newest member of the Supreme Court. (Joshua Roberts/Reuters)

Chief Justice John G. Roberts Jr. said Tuesday that the Supreme Court has gone about its work in a “completely nonpartisan way” since the death of Justice Antonin Scalia, but that the bitter political battle waged over confirming Scalia’s replacement poses a “real danger” for the court.

At a question-and-answer session at Rensselaer Polytechnic Institute, university President Shirley Ann Jackson asked Roberts about the “extremely partisan confirmation process” that saw Senate Republicans refuse to consider President Barack Obama’s choice of Judge Merrick Garland, and Democrats’ attempt to block President Trump’s choice of newly confirmed Justice Neil M. Gorsuch.

“I want to point out one thing — that throughout this whole process, the Supreme Court has been quietly going about its business of deciding the cases before it, according to the Constitution, in a completely nonpartisan way,” Robert said. “We’ve done it for the past 14 months with one vacancy, and we’ll do it going in the future now that we have a full complement.”

But he added: “It is a real danger that the partisan hostility that people see in the political branches will affect the nonpartisan activity of the judicial branch. It is very difficult I think for a member of the public to look at what goes on in confirmation hearings these days, which is a very sharp conflict in political terms between Democrats and Republicans, and not think that the person who comes out of that process must similarly share that partisan view of public issues and public life.”

Confirmations for the sitting Supreme Court justices were not nearly as partisan as Judge Gorsuch’s

It is a familiar stance for Roberts, but one he has had to repeat more often as Supreme Court confirmation votes for his new colleagues follow party lines. It is also one for which he is criticized by some.

The court’s rulings on major issues often conclude with the five members appointed by Republican presidents on one side, and the four nominated by Democrats on the other. The same is true on high-profile cases in federal courts around the country, where judges routinely divide along the lines of the party of the president who nominated them.

But Roberts insisted that judges shed political leanings when they join the bench.

“The new justice is not a Republican, not a Democrat, he is a member of the Supreme Court,” Roberts said. “But it is hard for people to understand that when they see the process that leads up to it.”

On other issues, Roberts repeated that he opposed allowing televised coverage of the Supreme Court and that having life tenure for federal judges is “incredibly important for what we do.”

One suggestion about reducing the political importance of Supreme Court nominations is having justices serve for a set number of years. Roberts was not asked specifically about that. But he said not having to worry about public approval was essential for judges to protect constitutional rights.

He mentioned a case involving the Westboro Baptist Church, the group that protests military funerals and blames natural disasters on society’s tolerance of gay rights. Roberts said the group’s speech is “absolutely hateful,” but also protected by the Constitution, which is what he wrote for a nearly unanimous court in 2011.

“If I hadn’t had life tenure and had to stand for election the next year, I wouldn’t vote for me,” he said.

Asked about cameras in the courtroom, Roberts agreed that televised coverage of the court would lead to a greater understanding of how it operates. “Our job, however, is not to educate the public,” but to decide cases, he said.

Oral arguments are free-flowing affairs where justices “follow along with the dynamic,” not worrying about how a hypothetical or sharp question will sound. If the justices had to think about how the public might judge a sound bite, he said, “we might end up talking like they do in Congress.”

Roberts noted that it was unusual for him to be making an appearance at a college like Rensselaer, dedicated to instruction on technology, science, engineering and mathematics. The link is that Jackson serves on the Smithsonian’s board of regents, which Roberts heads because of his position as chief justice.

To prepare, he said, he looked for connections to science among his 16 predecessors as chief justice. “As it turns out, there are very few,” he said. His own contribution, he said, will be giving this speech.