Different investors approach this differently; it depends on the velocity of investments they make and on how hands-on they are.
For instance, SV Angel (Ron Conway's fund) has an explicit policy much like YC's: they will invest in competing companies, but that they won't reveal one company's private information to another (and they don't really get involved in the management of their portfolio companies). Both SV and YC are making a lot of small, early-stage investments, so this makes sense for them.
A traditional VC, though, is very hands-on (usually a partner takes a board seat after an investment) and thus often has a policy of not investing in competing companies--it would just be too hard to not share information, at least implicitly, when you are sitting on the board and actively helping manage the company. Andreessen-Horowitz is a VC firm, and this seems to be their approach as well. It makes sense when you're making fewer, larger, later-stage investments.