Skip to content

Commit

Permalink
Change repr to describe()
Browse files Browse the repository at this point in the history
When the "parameters code" was added, it specified new behavior for `__repr__()`, listing *all* of the parameters whenever the object was returned to stdout. This is ok sometimes, but generates a massive amount of printed output in lifecycle models. Often the user just wants to do a quick check that an object is the class they think it is, or that there are the right number and kind of things in a list, and this behavior makes that impossible.

This commit *only* changes the function name `__repr__` to describe. I.e. the "list everything" behavior is still there, it just needs to be explicitly requested rather than assumed as the default.
  • Loading branch information
mnwhite committed Feb 28, 2024
1 parent 6a73c4f commit 8123924
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion HARK/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def __str__(self):
s += ">"
return s

def __repr__(self):
def describe(self):
return self.__str__()


Expand Down

0 comments on commit 8123924

Please sign in to comment.