2015-12-19 15:55:14 +00:00
|
|
|
|
|
|
|
class JunkComparisonException (BaseException):
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
class Junk:
|
|
|
|
|
2017-11-19 15:53:15 +00:00
|
|
|
def __init__ (self, represents = None):
|
|
|
|
assert(represents == None or isinstance(represents, basestring))
|
|
|
|
self.repr = represents
|
2015-12-19 15:55:14 +00:00
|
|
|
|
|
|
|
def __str__ (self):
|
2017-11-19 15:53:15 +00:00
|
|
|
if self.repr:
|
|
|
|
return '['+self.repr+']'
|
|
|
|
return "[junk]"
|
2015-12-19 15:55:14 +00:00
|
|
|
|
|
|
|
def __repr__ (self):
|
2017-11-19 15:53:15 +00:00
|
|
|
return self.__str__()
|
2015-12-19 15:55:14 +00:00
|
|
|
|
|
|
|
def __add__ (self, other):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __radd__ (self, other):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __sub__ (self, other):
|
|
|
|
return self
|
|
|
|
|
|
|
|
def __rsub__ (self, other):
|
|
|
|
return self
|