PEOPLE HERE love to tell visitors how they held a seasonal feast of freshwater crabs when Mao Tse-tung's unpopular widow Chiang Ching and three male cohorts were purged last fall. Discriminating Shanghai families each bought one female and three male crabs and gobbled them up with gusto.

The tale sums up a city that has managed to blend a sparkling revolutionary history with a taste of the good life. The Chinese Communist Party was born here in 1921. It chose as an unlikely spot for its first congress the downstairs living room of a wealthy capitalist and the place remains revolutionary shrine open to visitors and pictured on postcards.

An unannounced visitor intruding at midday into a teacher's apartment finds posters on the walls commemorating China's history of struggle against adversity but he also sees a full bowl of fried fish on the table.

The six-day work week reigns here, but enough people can take time off to jam the Shanghai No. 1 department store. A woman answers questions from foreigners about her planned purchase of a shiny new sewing machine without embarrassment while other shoppers ignore warnings from a salesgirl and crowd around to listen.

It is unclear just how much the average Shanghai resident suffered under Chiang Ching and the three dogmatist Shanghai city administrators who are known together as the "Gang of Four." The quartet did shut down many of the city's theater troupes and the droves of people lining up to see the reopened productions indicate that Shanghai really missed them.

Still, you have to work hard to get a rise out of the average Shanghai residents. At a circus and at a dance drama this week, it was the foreigners who provided most of the applause. The local residents saved their enthusiasm for the very high points.

"A bad local habit," said one city official, who later amended his remark to say the Chinese were just naturally more reserved.

They will respond to a deft combination of raw talent and political sentiment, however. The stars of a circus that had colorful acrobats and even a performing panda were two nondescript men in Mao suits who simply stood in front of their microphones and gave uncanny imitations of a million people at a party rally, a press printing Chairman Mao's works and Chinese jets shooting down enemy aircraft.

Many of the dozen or so men who started the party here in 1921 where educators, and Shanghai has grasped this pedagogical tradition with a vengeance. The lesson this year is "the crimes of the Gang of Four." No recordings of a favorite opera available? The Gang of Four supressed them. Factory missed its production quota? The Gang of Four again.

The Shanghai art gallery is running a popular exhibition of Gang of Four cartoons. The unfortunate quartet, and three of their middle-level cohorts in Shanghai, are shown being pummelled, squashed, skewered, maimed, mashed, blasted and otherwise done in by their own misdeeds and the wrath of the people.

Every visitor to a factory, farm or apartment complex gets a briefing on the gong's excesses. To students of Chinese politics these talks shed light in many dark corners, but to the uninitiated they can become tiresome.

"I've learned to despise the Gang of Four," said one Western visitor, although perhaps not in the way her Chinese hosts intended.

THE CHING CHIANG HOTEL, no relation to the fallen Chiang Ching, is a sprawling collection of buildings in the middle of town where foreign guests and Chinese dignitaries stay. The foreigners' section seems underpopulated this season. No more than two dozen people turn up for meals in the large dining room.

The isolation is deepened by the lack of Western newspapers. For readers of Chinese, the People's Daily comes in the afternoon but its editors have a leisurely attitude. One of the big stories of the month, a national conference on industry, appeared two days after the conference had begun. The handful of Americans passing through here are left to rely on each other for news and companionship, and that's how I met Shirley Temple Black.

She is on a multicity tour as the guest of the Chinese government with her husband, businessman Charles A. Black, after a stint as U.S. ambassador to Ghana and as chief of protocol in Washington. When the Chinese insisted that we switch tables at breakfast, having somehow violated a mysterious seating chart, the ambassador gave us a dimpled, bemused smirk that I had seen before.

At lunch the Blacks invited us to join them. All of us Californians, we chatted about Bay area politicans and water shortages Mrs. Black liked the way the Chinese were handling their water problems and was taking careful notes.

Now that the Gang of Four had fallen and China was safe even for Shirley Temple, did anyone here recognize her?

"I think everyone here over the age of [WORD ILLEGIBLE] has seen the movies," she said, flashing the dimples again.