Skip to content

Commit

Permalink
Edit Endpoint docstring. Use Self for Endpoint.__lt__.
Browse files Browse the repository at this point in the history
  • Loading branch information
salt-die committed Nov 27, 2023
1 parent 307d36d commit fb281a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/mind_the_gaps/gaps.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __str__(self):


@total_ordering
@dataclass
@dataclass(frozen=True, slots=True)
class Endpoint[T: SupportsLessThan]:
"""An interval endpoint."""

Expand All @@ -88,11 +88,11 @@ class Endpoint[T: SupportsLessThan]:
"""
The type of boundary.
A boundary can be either open or closed and either left or right "(" is open
and left, ")" is open and right,"[" is closed and left, and "]" is closed and right.
`"("` is open and left, `")"` is open and right,`"["` is closed and left, and
`"]"` is closed and right.
"""

def __lt__(self, other: "Endpoint") -> bool:
def __lt__(self, other: Self) -> bool:
if self.value != other.value:
return self.value < other.value

Expand Down

0 comments on commit fb281a6

Please sign in to comment.