Skip to content

Commit 8e41cb0

Browse files
Marenzllucax
andauthored
Update src/frequenz/sdk/timeseries/_base_types.py
Co-authored-by: Leandro Lucarella <[email protected]> Signed-off-by: Mathias L. Baumann <[email protected]>
1 parent 831116f commit 8e41cb0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/frequenz/sdk/timeseries/_base_types.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ class Sample(Generic[QuantityT]):
3636

3737
def __str__(self) -> str:
3838
"""Return a string representation of the sample."""
39-
return f"Sample({str(self.timestamp)}, {str(self.value)})"
39+
return f"{type(self).__name__}({self.timestamp}, {self.value})"
40+
41+
def __repr__(self) -> str:
42+
"""Return a string representation of the sample."""
43+
return f"{type(self).__name__}({self.timestamp=}, {self.value=})"
4044

4145

4246
@dataclass(frozen=True)

0 commit comments

Comments
 (0)