You can use anyand a generator expression :
if not any(self.is_legal(x) for x in (l, u, r, d)):
Or, if you prefer allinstead any:
if all(not self.is_legal(x) for x in (l, u, r, d)):
The first solution seems a little better though.
As for why your tried solution didn't work, the operator orin Python doesn't behave the way you think. From docs :
x or y x; x , ; y, .
, self.is_legal(l or r or d or u) self.is_legal, .