Staten Island District Attorney Daniel M. Donovan Jr., a Republican running for attorney general, yesterday set aside partisanship at a news conference hosted by New York City Mayor Michael R. Bloomberg to endorse legislation sponsored by a potential Democratic foe in November’s general election, state Senator Eric Schneiderman of Manhattan.

The measure, A6468c/S6005a, would require the “micro-stamping” of semi-automatic handguns so they leave distinctive letters and numbers on shell casings fired from those weapons that would allow authorities to trace the gun’s manufacturer and last legal seller.