Just drop the pretty repr from our struct for now

agg_feedz
Tyler Goodlet 2022-11-11 13:19:24 -05:00
parent 8476d8d056
commit d6fb6fe3ae
1 changed files with 10 additions and 9 deletions

View File

@ -42,16 +42,17 @@ class Struct(
for f in self.__struct_fields__ for f in self.__struct_fields__
} }
def __repr__(self): # Lul, doesn't seem to work that well..
# only turn on pprint when we detect a python REPL # def __repr__(self):
# at runtime B) # # only turn on pprint when we detect a python REPL
if ( # # at runtime B)
hasattr(sys, 'ps1') # if (
# TODO: check if we're in pdb # hasattr(sys, 'ps1')
): # # TODO: check if we're in pdb
return self.pformat() # ):
# return self.pformat()
return super().__repr__() # return super().__repr__()
def pformat(self) -> str: def pformat(self) -> str:
return f'Struct({pformat(self.to_dict())})' return f'Struct({pformat(self.to_dict())})'