Skip to content

Commit

Permalink
add default to string representation given by __str__
Browse files Browse the repository at this point in the history
  • Loading branch information
sdementen authored Mar 15, 2024
1 parent 4b7342b commit 3e47770
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion traces/timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ def format_item(item):
else:
items = ", ".join(format_item(_) for _ in self._d.items())

return f"{type(self).__name__}({{{items}}})"
default = f", default={self.default!r}".format(self.default) if self.default else ""

return f"{type(self).__name__}({{{items}}}{default})"

def iterintervals(self, n=2):
"""Iterate over groups of `n` consecutive measurement points in the
Expand Down

0 comments on commit 3e47770

Please sign in to comment.