From: Armin Ronacher Date: Sun, 18 Mar 2007 20:09:19 +0000 (+0100) Subject: [svn] __radd__ and co now works for Undefined too X-Git-Tag: 2.0rc1~426 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ec81af7297f55081d2cb4721394ce1aedb0799b;p=jinja2.git [svn] __radd__ and co now works for Undefined too --HG-- branch : trunk --- diff --git a/jinja/datastructure.py b/jinja/datastructure.py index 7da8813..2b53a58 100644 --- a/jinja/datastructure.py +++ b/jinja/datastructure.py @@ -49,9 +49,8 @@ class UndefinedType(object): raise TypeError('cannot create %r instances' % self.__class__.__name__) - def __add__(self, other): - return other - __sub__ = __mul__ = __div__ = __add__ + __sub__ = __mul__ = __div__ = __rsub__ = __rmul__ = __div__ = __radd__ = \ + __add__ = lambda self, other: other def __getitem__(self, arg): return self