Re: Comparing objects to built-in literals

2005-03-11 Thread [EMAIL PROTECTED]
The documentation tells that objects of different type are ordered arbitrailiy but consistently. You compare a class with an integer and a list, see : http://www.python.org/doc/2.3.5/lib/comparisons.html -- http://mail.python.org/mailman/listinfo/python-list

Comparing objects to built-in literals

2005-03-11 Thread Richard Hayden
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hi, Let's say I have a class which does not define __cmp__ or any of the rich comparison functions and let x be an instance of this class, then if I do: x < 2 or x < ['hello'] I get True everytime. Now, I know that when no __cmp__ etc. is defined, compa