That distinction comes courtesy of Zillow, the real-estate web-site, which took into account home values, population density, ease of walking and local crime data. In short, it’s best to trick-or-treat in safe, crowded, walkable neighborhoods where people are wealthy enough to hand out full-size Hershey’s bars.

Just behind San Francisco in the rankings are Boston, Honolulu, San Jose and Seattle. While it trumped us in baseball this year, Los Angeles ranked a mere sixth in trick-or-treating. Beat L.A.! (By the way, one potential Halloween costume comes cheap this year. At the AT&T Park’s Dugout Store, the children’s sales rack on a recent day was filled with Giants jerseys emblazoned with the name of now-Dodger Brian Wilson. Just add a beard and a bad attitude and you’re all set.)

Planning your trick-or-treat route already? Zillow says the best neighborhoods to hit up are Noe Valley, Seacliff, Cow Hollow, Presidio Heights and Glen Park. We wonder what a certain Glen Park denizen – Mayor Ed Lee – will be handing out to trick-or-treaters this year. Maybe if you come dressed as a Twitter nerd, you’ll get a tax rebate with your M&Ms.