I apologize for your mind being boggled. The stack trace displayed when the error is thrown should illustrate what line of code caused the named error as well as the specific name. You should also be using one of the supplied error formatters so that the stack trace is formatted in terms of the original template, instead of the generated code. A similar condition in Python, which is ubiquitous, is the "NoneType has no attribute 'foo'" type of error, where similarly you don't get to see what variable is incorrectly None unless you look at the stack trace. The condition here is exactly analogous, rather than the NameError example you cite.
UNDEFINED is a singleton constant so that you can use "x is UNDEFINED" on it, so it doesn't know what name is being called upon (just like None). Its behavior is described at http://www.makotemplates.org/docs/runtime.html#runtime_context_variables .
We may provide an option in version 4 so that "is" no longer works but the UNDEFINED object would be per-usage and store the name.
r9bd80bb55e97 includes a new flag on Template and TemplateLookup, strict_undefined=True. Set this flag and UNDEFINED is no longer used. Any name that is missing will raise an immediate NameError upon template render. This will be in 0.3.6 and you can get it now at http://hg.makotemplates.org/mako/archive/9bd80bb55e97.tar.gz . Please let me know if you have any issues with it, thanks.
>
> Istvan
>
>
> --
> You received this message because you are subscribed to the Google Groups "Mako Templates for Python" group.
> To post to this group, send email to mako-d...@googlegroups.com.
> To unsubscribe from this group, send email to mako-discuss...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mako-discuss?hl=en.
>
I'm noticing lately i have the urge to be a little sarcastic when theres a little bit of hyperbole coming my way, so I hope our mutual smarminess cancelled itself out !
anyway i made some more changes to the parser to accommodate some new issues that change raises so you should get the latest tip.
>
> best regards,