make HyCons repr indented and multi-line
This commit is contained in:
parent
7674bf3267
commit
860431b2a5
@ -353,9 +353,13 @@ class HyCons(HyObject):
|
|||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
if isinstance(self.cdr, self.__class__):
|
if isinstance(self.cdr, self.__class__):
|
||||||
return "<HyCons (%s %s)>" % (repr(self.car), repr(self.cdr)[9:-2])
|
return "<HyCons (\n %s%s" % (
|
||||||
|
repr(self.car).replace('\n', '\n '),
|
||||||
|
repr(self.cdr)[9:])
|
||||||
else:
|
else:
|
||||||
return "<HyCons (%s . %s)>" % (repr(self.car), repr(self.cdr))
|
return "<HyCons (\n %s\n. %s)>" % (
|
||||||
|
repr(self.car).replace('\n', '\n '),
|
||||||
|
repr(self.cdr).replace('\n', '\n '))
|
||||||
|
|
||||||
def __eq__(self, other):
|
def __eq__(self, other):
|
||||||
return (
|
return (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user