For what it's worth, the syntax suggested was originally part of the
proposal.

>From http://webpy.org/templetor
"There are a couple changes from Python: for and while now take an
else clause that gets called if the loop is never evaluated."

This was removed when Anand rewrote templetor for 0.3 release I
believe.


On Jan 18, 2:54 pm, Pablo Antonio <[email protected]> wrote:
> On Mon, Jan 18, 2010 at 10:46:39AM -0800, andrei wrote:
> > Yep, I meant using "else" in "for" loop.
>
> Oh, ok. Well, if I'm not mistaken, the language used in web.py's
> templates is a subset of Python. The behavoiur Branko just commented is
> not how for-else works in Python code, AFAIK:
>
> >>> for x in range(2):
>
> ...     print x
> ... else:
> ...     print 'else'
> ...
> 0
> 1
> else
>
> Anyway, Branko's alternative looks good enough to me, and it's clearer.
>
> Thanks,
>
> --
> Pablo Antonio (AKA crazy2k)http://www.pablo-a.com.ar/
-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.


Reply via email to