correct handling of __eq__ comparison of ranges with non-ranges

I originally thought a more useful error message was all that's needed, but it turns out that raising any exception here causes problems with SQLAlchemy's internal state tracking.