On 12:50 pm, [email protected] wrote:
On Fri, Aug 7, 2009 at 8:00 AM, dmitrey<[email protected]>
wrote:
hi all,
is it possible to overload operator "< �<"? (And other like this one,
eg "<= �<=", "> �>", ">= �>=")
Any URL/example?
Thank you in advance, D.
That isn't an operator at all. Python does not support compound
comparisons like that. You have to do "a > b and b > c".
That's partially correct. There is no "compound less than operator", or
whatever you want to call that. However, Python does support "compound
comparisons" like that:
>>> 1 < 2 < 3
True
>>> 1 < 3 < 2
False
>>> 1 == 2 == 3
False
>>> 2 == 2 == 2
True
>>>
Jean-Paul
--
http://mail.python.org/mailman/listinfo/python-list