WD40 is basically kerosene. It definitely is water-displacing, and a decent penetrant, but it does not leave much of a lubricating film since it is volatile enough to rather completely evaporate over time (And it also removes any vestiges of protectant film that were on the surface already), so once the WD40 dries, the surface will rust like crazy if you aren't careful.
It's great for getting things unstuck, or temporary lubrication of surfaces that don't corrode quickly once they're stripped. For actual lubrication for continued use, or to leave a protective film, you need to wipe down the item with 3-in-1 or a good gun oil like RemOil after getting whatever was stuck working freely again.
It's not the best idea in the world to use it as a primary lubricant on a carry gun that stays loaded, WD40 does have some pretty effective penetrating qualities and particularly if you are carrying handloads that haven't been sealed with lacquer at the primer and the neck, there is a chance it can work its way into the primer and kill it, which could lead to embarassing if not fatal consequences.