On Aug 3, 11:29 am, "Aaron Swartz" <[EMAIL PROTECTED]> wrote:
> > stil fails, with error "could not find 'myvar'".  I realized after
> > playing with it a bit that the second line must be indented for this
> > to work.  It's still a little unclear to me which cases indentation is
> > required for.
>
> Indentation is required for loop bodies, just like in normal Python.
> Is that confusing?

For me it was.  This is probably some combination of (a) I'm moving
the code from Cheetah, which doesn't use indentation this way, and
(b)  the examples on the doc page didn't seem clear as to whether the
indentation was crucial or happenstance.  The main example showing a
lot of indentation is marked as unimplemented.  Also adding to the
confusion is that nothing under the 'def' need be indented, even
though this would be required in Python.

Also, I'm not sure, but I think in playing with this that I had code
like this

$if blah:
$if asdf:
qwerty

(i.e., no indentation) and it worked, rather than drawing a diagnostic
message.

It would be helpful to have a somewhat complex example on (or linked
from) the doc page that demonstrates all of the basic usage patterns,
in the context of a complete example.


--~--~---------~--~----~------------~-------~--~----~
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