Return TypeError for comparisons, if self is not a real

see #7785