But Walsh’s victory can also be attributed to the inability of rival John R. Connolly to see him for what he was: a worthy opponent, with a smart campaign strategy and a loyal network of progressive friends who extended beyond union halls. Connolly underestimated Walsh, the same way Martha Coakley underestimated Scott Brown in their now-legendary showdown. In both cases, arrogance led to complacency, which led to defeat.

Walsh’s first-place finish in the preliminary should have warned Connolly of the dangers ahead. Instead, the Connolly camp wrongly believed that a “schools first” reform pitch was enough to catapult Connolly to victory — while Walsh’s labor connections would sink him.

Walsh’s union supporters helped deliver this election to him, along with fliers that described Connolly as a child of privilege. A last-minute burst of outside money from a mysterious source helped, too.

But Walsh also worked a theme of unity and inclusion when he won endorsements from Felix Arroyo, John Barros, and Charlotte Golar Richie. An endorsement from Mel King, the only black Bostonian to ever make it to a mayoral final, helped seal the deal with older minority voters. Backing he received from popular female elected officials like state Senator Linda Dorcena Forry was also important.

Given all that, it was hard to paint Walsh with the old Boston conservative white-guy brush. Now, as mayor-elect, he must paint an even fuller picture of who he is. And, if he really wants to reassure the doubters about his ability to stand up to labor, it would be wise to keep Ed Kelly, head of the state firefighters union, off his transition team.