Supporters of the Goldwater Rule have cited three main rationales for adhering to it: Most diagnoses made from a distance turn out to be wrong; the labels themselves can cause real harm to the person and family members; and the practice undermines the field’s credibility, particularly its commitment to confidentiality. Not to mention, others say, that it could expose a left-leaning bias in the field.

But the psychoanalyzing of public figures by commentators, columnists and pop psychologists has a bipartisan history. Concerns about grandiosity and narcissism dogged Lyndon B. Johnson’s presidency. Suspicions of a deepening paranoia clouded the end of Richard Nixon’s. Accusations of manipulation, deceit and a sense of entitlement have trailed the Clintons for years, prompting speculation about deeper personality problems.

Mr. Trump himself has recently tried to turn the tables, accusing Hillary Clinton of being “unstable” and “unhinged.”

While the vast majority of therapists’ comments remain focused on Mr. Trump, some in the profession say that if public psychoanalyzing is going to be done, it should be directed at both candidates.

“Do those things rise to a diagnosable level? I sure don’t know,” said Don Sizemore, a family therapist in Lexington, Ky. “But if we’re diagnosing him, we should be doing the same for her.”

Yet history cautions against the armchair analysis of either one. Psychiatrists point to Goldwater himself as a prime example of getting it wrong. By the time he died in 1998, Mr. Goldwater was regarded as “one of his party’s most respected elder statesmen,” The Washington Post said in its obituary.

In the wake of the Monica Lewinsky scandal, many people longed for a diagnosis to explain or denounce President Bill Clinton’s behavior, said Dr. Nada Stotland, a psychiatrist at Rush Medical College in Chicago. “I remember getting all these media calls asking if he was a narcissist or a sex addict,” she said. “Well, sex addiction wasn’t a recognized disorder at the time. And if it had been, was the behavior then not his fault? I ended up dancing around these questions, because this idea that we should go around, willy-nilly, putting diagnoses on people is just wrong.”