Why keep identity-based equality comparison?
Fuzzyman
fuzzyman at gmail.com
Tue Jan 10 10:46:41 EST 2006
Peter Decker wrote:
> On 10 Jan 2006 13:33:20 GMT, Antoon Pardon <apardon at forel.vub.ac.be> wrote:
>
> > IMO if they aren't of the same type then the answer to:
> >
> > a < b
> >
> > is just as obviously False as
> >
> > a == b
> >
> > Yet how things are proposed now, the first will throw an exception
> > and the latter will return False.
>
> I don't see the two comparisons as equivalent at all. If two things
> are different, it does not follow that they can be ranked. If we have
> two objects, such as a spark plug and a cam shaft, it is one thing to
> say that the two are not the same object; it is quite another to say
> that one is 'greater than' or 'less than' the other.
>
I agree.
If a and b are of incomparable types, then a != b is True but a < b is
meaningless.
All the best,
Fuzzyman
http://www.voidspace.org.uk/python/index.shtml
> --
>
> # p.d.
More information about the Python-list
mailing list