      def _curried(*moreargs, **morekwargs):
          return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))
      return _curried
  
  def lazy(func, *resultclasses):
      """
      Turns any callable into a lazy evaluated callable. You need to give result
      classes or types -- at least one is needed so that the automatic forcing of
 
</s> remove     class __proxy__:
 </s> add     class __proxy__(Promise): </s> remove             assert isinstance(message, basestring), ("'%s' should be a string" % message)
 </s> add             assert isinstance(message, (basestring, Promise)), ("'%s' should be a string" % message) </s> remove             assert isinstance(message, basestring), ("%s should be a string" % repr(message))
 </s> add             assert isinstance(message, (basestring, Promise)), ("%s should be a string" % repr(message))
class Promise:
    """
    This is just a base class for the proxy class created in
    the closure of the lazy function. It can be used to recognize
    promises in code.
    """
    pass

      def _curried(*moreargs, **morekwargs):
          return args[0](*(args[1:]+moreargs), **dict(kwargs.items() + morekwargs.items()))
      return _curried
  
class Promise:
    """
    This is just a base class for the proxy class created in
    the closure of the lazy function. It can be used to recognize
    promises in code.
    """
    pass

  def lazy(func, *resultclasses):
      """
      Turns any callable into a lazy evaluated callable. You need to give result
      classes or types -- at least one is needed so that the automatic forcing of
keep keep keep add keep keep keep keep
 fixes #753 - ValidationError and CriticalValidationError now accept both strings and promises from gettext_lazy


git-svn-id: http://code.djangoproject.com/svn/django/trunk@1328 bcc190cf-cafb-0310-a4f2-bffc1f526a37 
django/utils/functional.py