scripts: Added __repr__ to RInt and friends

Just a minor quality of life feature to help debugging these scripts.
This commit is contained in:
Christopher Haster
2024-12-05 11:50:02 -06:00
parent e4ff9a1701
commit faf4d09c34
9 changed files with 36 additions and 0 deletions

View File

@@ -52,6 +52,9 @@ class RInt(co.namedtuple('RInt', 'x')):
x = int(x)
return super().__new__(cls, x)
def __repr__(self):
return '%s(%r)' % (self.__class__.__name__, self.x)
def __str__(self):
if self.x == mt.inf:
return ''