forked from Imagelibrary/littlefs
scripts: Added __repr__ to RInt and friends
Just a minor quality of life feature to help debugging these scripts.
This commit is contained in:
@@ -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 '∞'
|
||||
|
||||
Reference in New Issue
Block a user