[BangPypers] date range
Roshan Mathews
rmathews at gmail.com
Tue Feb 9 12:33:33 CET 2010
On Tue, Feb 9, 2010 at 16:51, Srinivas Reddy Thatiparthy
<srinivas_thatiparthy at akebonosoft.com> wrote:
>
>>>more compact is_in_range startdate < date < enddate
>
> I am very much interested to know how the above expression is evaluated
> in compiler?
> If the compiler evaluates left to right ,startdate<date becomes True or
> false depending on the values and
> Now, my question is how this (True/Flase < enddate) will be evaluated
> since they are of different types?
> Or am I missing something?
>
http://docs.python.org/reference/expressions.html#notin
<quote>
Formally, if a, b, c, ..., y, z are expressions and op1, op2, ...,
opN are comparison operators, then a op1 b op2 c ... y opN z is
equivalent to a op1 b and b op2 c and ... y opN z, except that each
expression is evaluated at most once.
</quote>
Roshan
More information about the BangPypers
mailing list