By Scott Wilson

To the uninitiated, the bright-orange, Tic Tac-size specks scattered on the sidewalks, wedged into the openings of heating grates and piled in small mounds along curbs here are a bit of a mystery.

They are the sterile plastic caps to hypodermic needles, tossed aside by the scores of heroin addicts who dwell outside Twitter and Banana Republic and City Hall. The local government distributes them free to protect drug users from disease.

At the same time, the city has banned the use of another plastic item: the drinking straw. The law’s supporters say it will prevent a million straws a day from washing into the San Francisco Bay.

“Napkins, straws, and bags are available upon request,” reads a footnote on the menu of the Sentinel, a walk-up sandwich shop in the city’s thriving financial district. “You can still get needles for free though. Welcome to SF.”

The streets of San Francisco — hilly, curvy, cinematic and, in recent years, a bleak showcase for the mentally ill and economically displaced — have long reflected this eccentric city’s governing priorities and many civic contradictions.