Comparison of different types does not throw exception

Grant Edwards grante at visi.com
Fri Jul 13 09:50:11 EDT 2001


In article <slrn9ktr6c.1n8.philipprw at chello213047126184.14.univie.teleweb.at>, Philipp Weinfurter wrote:

>hmm, i'm still new to python, so please correct me if i'm wrong here.
>but since you can not subclass `integer' and `string' (and override the 
>comparison operators for those types), there is not much polymorphism here.
>and as the language reference states:
>"Otherwise, objects of different types always compare unequal, and are
>ordered consistently but arbitrarily."
>i, too, think that this doesn't make much sense.

It's also no longer true for all types.  

-- 
Grant Edwards                   grante             Yow!  PUNK ROCK!! DISCO
                                  at               DUCK!! BIRTH CONTROL!!
                               visi.com            



More information about the Python-list mailing list