Opinion: Politics isn’t pretty. But politicians are.

At a Beto O’Rourke rally near Dallas shortly before the midterms, Sonia Qutob, 41, turned to her friend and asked what was clearly the most pressing question about the candidate.

“Do you think,” she said, “that he needs a second wife?”

O’Rourke seems to me plenty happy with the first. But a fangirl can dream. At the rally immediately preceding the one where Qutob swooned, dozens of them mobbed O’Rourke and clamored for selfies. The passions that animated them were clearly more than political.

Before we leave the midterms too far behind and exhaust our fine-grained analysis of the electorate’s every cough and sputter, let’s take a moment to be shallow, which is to say honest. O’Rourke and Andrew Gillum soared to fame and impressive vote totals in, respectively, Texas and Florida because they were eloquent, energetic and empathetic counterpoints to their Republican rivals and to Donald Trump.

Also, they’re hunks.

Alexandria Ocasio-Cortez of New York became the youngest woman ever elected to the House on the strength of her story, the purity of her vision and the smarts of her strategy.

But her celebrity isn’t hindered by her gorgeousness. She has nearly 825,000 followers on Instagram — more, Politico recently noted, than Nancy Pelosi and Paul Ryan combined.

There’s obviously ample room in politics for people of all strata of comeliness, as any gallery of presidential portraits or group photo of members of Congress shows.

But many candidates’ personas are inseparable from their looks, whether those looks cast them as bookish, nurturing, approachable or, yes, hot. And in politics, as in much else, hot helps.

“From a very early age, we’re drawn to more attractive faces — even babies prefer that,” Deborah Rhode, a Stanford University law professor, told me. She’s the author of “The Beauty Bias: The Injustice of Appearance in Life and Law.” It explains that better-looking defendants fare better with juries.

But the advantages of attractiveness aren’t confined to any one situation or goal, she noted. They’re cumulative. “Teachers give less attention to less attractive children,” Rhode said. “Children ascribe intelligence to good-looking individuals and prefer them as friends.”

Rhode mentioned John F. Kennedy as a prime example from the past of a politician assisted by his appearance. She mentioned Justin Trudeau, the Canadian prime minister, as an example from the present.

Nancy Etcoff, an evolutionary psychologist who teaches at Harvard Medical School and wrote a book titled “Survival of the Prettiest,” said that there was almost certainly more forgiveness in the days of Abraham Lincoln, who, she noted, “considered himself homely.”

Etcoff asked: “Would he be elected now? I would hope the answer is yes. But it’s a real question.”

So is whether there’s such a thing as too attractive, at least for women. If you’re a dazzler, Rhode said, “You have more difficulty being taken seriously.” Ocasio-Cortez has already felt the sting of this.

When it comes to looks, as to so much else, women in politics are asked to thread a needle. They mustn’t ignore their appearance. But they also mustn’t flaunt it.

Men get into trouble mainly if their physical vanity becomes much too obvious, as President Emmanuel Macron of France learned when he was mocked for spending $30,000 on makeup during his first three months in office and as John Edwards discovered in the aghast response to his $400 haircuts during his 2008 presidential campaign.

O’Rourke sidestepped that problem by leaning into the Texas heat and sweating copiously through his shirts, so much so that it yielded a subgenre of journalism about his perspiration. He was a proud human sponge. But here’s the thing: Can you get away with being that soggy if you aren’t that pretty?

Writes for The New York Times.