BOSTON (AP) _ Come Sunday, shorts, T-shirts and sandals will be on the list of forbidden attire for Boston cab drivers.

Prompted by complaints from hoteliers, the police department's Hackney Carriage Unit has set up a dress code aimed at putting polish back in the taxi ranks.

Men must wear trousers and collared shirts - ties optional. Hair must be trimmed neatly. Beards and moustaches are permitted, but they must be neat.

Women will be required to don dresses, skirts or slacks, shirts with collars, blouses or sweaters, and shoes.

The 14 officers of the Hackney Carriage Unit will enforce it, and state police will order unkempt or inappropriately dressed cabbies out of Logan Airport. Violators face the loss of their cab permits.

The policy received mixed reactions among the estimated 8,000 to 10,000 full- and part-time cab drivers in Boston.

With a tilt of his uncombed head and a smile on his beard-stubbled face, Gary Finneran, a cab driver of 12 years running, asked, ''Do you think you'd be afraid to get a ride with me?''

Finneran, 31, was critical of the impending dress code as he waited for customers outside the plush Hotel Meridien in the city's financial district.

''We're only trying to work, to make a dollar,'' Finneran said. ''Try driving 12 or 13 hours a day, three days in a row and see if you can find time to shave.''

Ed Bailey, 63, who has been driving cabs for 30 years, thought the dress code was a good idea.

''When I first started, everybody was wearing chauffeurs caps and jackets,'' he said. ''Some of these people have been wearing junk ... T-shirts and tank tops.''

Staying cool in a sleeveless, collarless net shirt, David Golden, 40, said he doesn't mind the idea of uniform dress for cab drivers. He only wished there was a summer exemption.

Golden, who emigrated from the Soviet Union to the United States five years ago, said Boston summers are hard on him.

''You spend a lot of time inside. Sometimes the air-conditioning doesn't work. Maybe for people who were born in this country ... for me it's maybe a little uncomfortable.''

Lt. Detective Donald L. Devine, head of the Hackney unit, said Boston is only falling in line with some other major American cities in enacting a dress code.

The code resulted from his survey of 25 Boston hotels soliciting comment on the city's taxi service. Many complaints concerned the poor or dirty condition of the cabs and the drivers' appearance, he said.

Someone higher up has a complaint, too.

''We have a mandate from the mayor (Raymond Flynn) to improve the taxi industry,'' Devine said. ''The mayor realizes that cab drivers are a very important and dynamic part of the community. They're ambassadors for the city.''