Test for line of sight

What’s the best way to test for a line of sight between two objects?

Oh, nevermind, I guess you can just do this:

#  Test for LOS between obj1 and obj2
objTmp = obj1.castRayTo (obj2)
if objTmp == obj2 :
    lineOfSight = True
else :
    lineOfSight = False