how to overload operator "< <" (a < x < b)?

Peter Otten __peter__ at web.de
Fri Aug 7 08:21:31 EDT 2009


dmitrey wrote:

> is it possible to overload operator "<  <"? (And other like this one,
> eg "<=  <=", ">  >", ">=  >=")

No. 

a < x < b 

is a shortcut for 

a < x and x < b

where x is of course evaluated only once.

Peter





More information about the Python-list mailing list