[svn] __radd__ and co now works for Undefined too
authorArmin Ronacher <armin.ronacher@active-4.com>
Sun, 18 Mar 2007 20:09:19 +0000 (21:09 +0100)
committerArmin Ronacher <armin.ronacher@active-4.com>
Sun, 18 Mar 2007 20:09:19 +0000 (21:09 +0100)
--HG--
branch : trunk

jinja/datastructure.py

index 7da8813e166d97e312face677b9e054ab1c7a175..2b53a5840494c7ed142c736e81d9775f67758fad 100644 (file)
@@ -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