Skip to content

Commit bdb81dc

Browse files
committed
Add Interval repr
add typing to repr Add repr docstring
1 parent 8573b0b commit bdb81dc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/napari_matplotlib/util.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ def __init__(self, lower_bound: Optional[int], upper_bound: Optional[int]):
2828
self.lower = lower_bound
2929
self.upper = upper_bound
3030

31+
def __repr__(self) -> str:
32+
"""
33+
Get string representation.
34+
"""
35+
return f"Interval({self.lower}, {self.upper})"
36+
3137
def __contains__(self, val: int) -> bool:
3238
"""
3339
Return True if val is in the current interval.

0 commit comments

Comments
 (0)