8245: improve Rational comparisons

fixes #8245
I think, you can move this part up, i.e.:
```
if other.is_Number:
    ...
elif other.is_number and other.is_real
    ...
```