From fd0bb9b6771f0eb4e6c91339d033b48a86176918 Mon Sep 17 00:00:00 2001 From: Chris McDonough Date: Sun, 4 Apr 2010 07:23:53 +0000 Subject: [PATCH] --- colander/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/colander/__init__.py b/colander/__init__.py index be18698..653ac0e 100644 --- a/colander/__init__.py +++ b/colander/__init__.py @@ -138,7 +138,8 @@ class Function(object): the function is called with the ``value`` during validation. If the function returns anything falsy (``None``, ``False``, the - empty string, ``0``, etc) when called during validation, an + empty string, ``0``, an object with a ``__nonzero__`` that returns + ``False``, etc) when called during validation, an :exc:`colander.Invalid` exception is raised (validation fails); its msg will be the value of the ``message`` argument passed to this class' constructor. @@ -150,7 +151,8 @@ class Function(object): (validation fails). If the function returns anything *except* a stringlike object - object which is truthy (e.g. ``True``, 1), an + object which is truthy (e.g. ``True``, the integer ``1``, an + object with a ```__nonzero__`` that returns ``True``, etc), an :exc:`colander.Invalid` exception is *not* raised (validation succeeds).