##// END OF EJS Templates
Allow adding macros.
Thomas Kluyver -
Show More
@@ -51,3 +51,10 b' class Macro(object):'
51 def __getstate__(self):
51 def __getstate__(self):
52 """ needed for safe pickling via %store """
52 """ needed for safe pickling via %store """
53 return {'value': self.value}
53 return {'value': self.value}
54
55 def __add__(self, other):
56 if isinstance(other, Macro):
57 return Macro(self.value + other.value)
58 elif isinstance(other, basestring):
59 return Macro(self.value + other)
60 raise TypeError
General Comments 0
You need to be logged in to leave comments. Login now