1
0
infernal-interpreter/Junk.py
Jon Michael Aanes 8b146efe68 Added Junk value, for which all operations are
defined to produce junk.
Any comparison involving junk triggers the i status register.
Any conditional jump triggered when the i register is true,
triggers a python level exception.
2015-12-19 16:55:14 +01:00

28 lines
353 B
Python

class JunkComparisonException (BaseException):
pass
class Junk:
def __init__ (self):
pass
def __str__ (self):
return "[Junk]"
def __repr__ (self):
return "[Junk]"
def __add__ (self, other):
return self
def __radd__ (self, other):
return self
def __sub__ (self, other):
return self
def __rsub__ (self, other):
return self