- UNDEFINED evaluates to False
diff --git a/CHANGES b/CHANGES index cead590..ec1e653 100644 --- a/CHANGES +++ b/CHANGES
@@ -1,3 +1,6 @@ +0.1.3 +- UNDEFINED evaluates to False + 0.1.2 - fix to parsing of code/expression blocks to insure that non-ascii characters, combined with a template that indicates a non-standard
diff --git a/lib/mako/runtime.py b/lib/mako/runtime.py index b499249..20748b9 100644 --- a/lib/mako/runtime.py +++ b/lib/mako/runtime.py
@@ -76,6 +76,9 @@ """represents an undefined value in a template.""" def __str__(self): raise NameError("Undefined") + def __nonzero__(self): + return False + UNDEFINED = Undefined()