For a moment it was like the good old days for the rumpled, white-haired politician who holds the Mediterranean's toughest port city in the palm of his hand. There was his name under a front page editorial attacking local Communists as "Stalinsts."

"You saw the little threat in the last paragraph?" Mayor Gaston Deffere purred over the telephone to a political ally. "No, we don't go after the others yet," he said, speaking of his rightist opposition. "They can wait."

Defferre first came to power here at the end of World War II, as much because of his ability in the Resistance to use a machine gun and explosives as for his political skills. Since then he has built a city political machine that is the most formidable in France and rivals anything done in Boston or Chicago.

Seated in his office overlooking the Old Port of Marseilles on a recent morning. Deffere, 66, sounded much more like The Last Hurrah than the Mediterranean folklore or Cesar, Marius and Fanny.

Part of Defferre's success has been built on his ability to thump the region's well-organized Communist Party and the local Gaullists regularly by producing center-right coalitions headed by Defferre's Socialist Party. A former Presidential candidate, Defense is one of the important Socialist leaders nationally.

But the campaign that is likely to be his last for mayor has given him few chances to attack the Communists. In the newly polarized politics of France, the Socialists and Communists have made a national alliance and Deffere has had to disband the coalition he normally governs with and promise to take Communists into the city government if he is reelected.

Defferre and other old-line Socialist leaders, who have long fought the Communists for supremacy of the French left, evidently see such arrangements as the price they must pay for continuing cooperation that could bring the Socialist-Communist coalition to victory in the 1978 parliamentary elections.

Voters go to the polls Sunday in the 36,575 municipalities of France in the first round of balloting. The local elections will have far more national significance than is usually the case here.Run-off elections in most districts, where there are no absolute majorities on the first day of voting, will be held March 20.

Even if they do not pick up a single vote more than the 12 per cent they polled in the last municipal elections in 1971, the Communists are almost certain to enter 35 to 40 new important city councils on the coattails of the Socialists in this month's voting.

The two parties have agreed on single states of candidates for the city council races in 204 of France's 221 municipalities with populations of more than 30,000.

The generosity of the Socialist Party's national leadership in ceding safe spots on these tickets to Communist candidates has led many political analysts to conclude that the Socialists are making a sort of down payment for reciprocal "reasonableness" from the Communists in the far more vital parliamentary elections.

Here is Marseilles, however, Deferree intends to deal from strength rather than negotiation. He will give the Communists posts in the city government, he promises, but only after he has thrashed them at the polls. He and 16 other Socialist mayors in France have refused to open their slates to the Communists, despite strong Communist demands they do so.

"The election here will be a good chance to measure the relative strength of the two parties," Defferre said, weighing his comments about the Communists far more carefully than he has had to the past.

"Nationally, we will go all the way to power with the Communists," Deferre said in an interview. "I think the Communists are sincere in saying they are changing" and accepting democratic rules. "But we need time to raise a new generation that will not have the Stalinist experience of older Communists."

While the single slates elsewhere will give a strong impression of progress the left has made, since the Communists are certain to make the largest gains of city council seats, the race in Marseilles will indicate the problems that remain between the two parties.

It also illustrates the light grip placed on Marseilles by Defferre, an unusual Socialist because he is a millionaire, and an untypical man of the French Midi, since he is Protestant, does not dring the local pastis apertif nor play the local sport of boule , a lawn bowling game like the Italian bocce , using steel balls.

The editorial blast linking the local Communist ticket's campaign tactics to the "typical Stalinist way of telling a lie and repeating it as fact" appeared in this city's largest newspaper, Le Provencal, which never attacks Defferre's policies. He happens to be publisher and part-owner of the paper.

An active leader of the underground Resistance forces during the Nazi occupation, Defferre gained control of the newspaper when the Germans were driven from the city. He also gained the upper hand on the provisional municipal council set up at the end of war, but gave it up a year later. After building a solid base, he came back in 1953 to the mayor's chair.

Since then, he has regularly beaten both Communists and Gaullists in municipal and parliamentary elections, asserting that he has bounced the gangsters out of City Hall and tamed the cutthroat underworld that ran "the French connection" out of a heroin laboratory here.