order of test

Dave Cole djc at object-craft.com.au
Mon Jul 29 10:07:17 EDT 2002


> Andrew McNamara <andrewm at object-craft.com.au> writes:
> > >can we be sure of the order of a test expression ?
> > >i mean that
> > >t=["one","two"]
> > >x=10
> > >if x<2 and t[x]=="oups":
> > >
> > >will never throw an exception if t[2] will be tested before x<2
> > 
> > It's called lazy evaluation, 
> 
> No it's not!  Lazy evaluation is more like Haskell...

I think the proper term is short circuit evaluation but don't quote
me...

- Dave

-- 
http://www.object-craft.com.au



More information about the Python-list mailing list