Python docs [was: function with a state]

Xah Lee xah at xahlee.org
Fri Mar 25 01:24:11 EST 2005


umm... looks like it should've been:

Comparison can be chained, and is equivalent to a sequence of
comparisons with “and” in between. For example, “x<y<=z” is
effectively “(x<y) and (y<=z)”

 Xah
 xah at xahlee.orghttp://xahlee.org/

Terry Reedy wrote:
> >Comparisons can be chained, and is evaluated from left to right. For
> >example, x < y <= z is equivalent to (x < y) <= z.
>
> The proposed 'correction' above is incorrect and should be ignored.
>
> >>> x,y,z = 2,3,1
> >>> x<y<=z
> 0
> >>> (x<y)<=z
> 1
> 
> Terry J. Reedy




More information about the Python-list mailing list