In many locations, this exists in practice - especially if you rent parts of a building that you reside in (one half of a duplex or 1/4th of a quadplex, etc).

In some cases, anti-discrimination laws don't even apply.