Depends on 3 things, mainly, Your Bike, the Sidewalk, and Your local's attitudes towards you..
Sidewalks, there are the 3ft wide, only enough for 1 pedestrian, crowded with constant foot traffic ** ( I would get off my bike and walk with it across that section ) ..
Then there are the sidewalks that are 8ft wide and have barely never anyone in sight while the roads are packed bumper to bumper with cars.... i would not think twice about it, i'd be on that sucker like flies to a S!@#pile..
Me, in NB, some of the bridges are safe while others are suicide, the people are friendly ( mostly ) and courteous , but some spots are deadly and cars get into accidents all the time , like a 4 way traffic light at the bottom of a huge bridge that you dont see until you get to the top... no way in hell i'm getting my ass near that type of stuff no matter what bike i'm on.
Then the bike, some of my bikes have no problem keeping up with city traffic, while one's like my A2B are slow off the line and much more bicycle than motorcycle. this changes how i ride drastically.. being in the middle of the lane with the flow of cars at partial throttle is fun, stuck to the right side getting passed way too closely by traffic goin 40 kph more than i am... no fun.
To hell with the law.. do what's safe for your own ass !