The first thing to understand about San Francisco politics is with just 7.4 percent of its voters registered as Republicans, the city’s main players are self-proclaimed liberals – or “progressives” in the preferred nomenclature.

The second thing, however, is that in San Francisco, politics is a blood sport and careers can be made or lost by even tiny conflicts of ideology, sexual orientation, ethnicity or personality.

San Franciscans – and the rest of us, vicariously – will soon see another exposition of the city’s unique politics because its affable mayor-by-happenstance, Ed Lee, collapsed while grocery shopping last week and died.

WeeklyWalters: your Friday newsletter for all of Dan's columns.

“This is not a time for political intrigue,” city Supervisor Aaron Peskin said shortly after Lee’s death was announced. “This is the time to send a message to the people of the City and County of San Francisco that we can and will govern.”

Other local politicians said much the same thing, eschewing any interest in political maneuvering during the period of mourning.

Fat chance.

Almost immediately, the city’s political plotters and schemers began plotting and scheming over Lee’s successor as mayor.

Initially, the title of acting mayor falls to London Breed, who happened to be president of the city’s governing body, the Board of Supervisors, when Lee died.

That’s how Dianne Feinstein became acting mayor of San Francisco in 1978 when then-Mayor George Moscone was assassinated by another politician. She later won two full terms and lost a 1990 bid for governor, but won her U.S. Senate seat in 1992.

Conversely, when then-Mayor Gavin Newsom became lieutenant governor in 2011, he, former Mayor Willie Brown and political powerhouse Rose Pak joined forces to persuade city supervisors to make Lee, then the city administrator, interim mayor on his promise not to run in 2011. He later reneged and won a term on his own that year.

Those two cases illustrate two points – that filling a mayoral vacancy in San Francisco is a very political process, and that the mayoralty can be, as it was for Feinstein and Newsom, an important rung on the political ladder.

The supervisors could allow Breed to remain as interim mayor, ala Feinstein. But that would freeze out the many other mayoral hopefuls who were planning 2019 bids because she’s virtually declared her intent to run. Or the board could name someone else to fill out Lee’s term, just as he was appointed in 2011, and block Breed.

Brown, the former mayor and legendary speaker of the state Assembly, will play a big role in what happens. He is largely responsible for Newsom’s succeeding him as mayor, for Lee’s conversion from bureaucrat to politician, and for Kamala Harris’ rapid rise from local prosecutor to state attorney general and then to a U.S. Senate seat. He also has close personal and political ties to Breed.

In San Francisco terms, Brown is not considered to be very progressive, and by wielding behind-the-scenes power in local politics, he has frustrated those on the city’s left wing.

They contend that the city has been too accommodating to developers, high-tech firms and other business interests and too oblivious to the homeless, the working poor and other San Franciscans who have not participated in its obvious economic boom and suffer from its traffic congestion, sky-high rents and other living costs.

The back-to-back processes of choosing an acting mayor and then electing either that person or someone else will be a test of Brown’s clout, and a referendum on the city’s ideological direction in the years ahead.