Skip to content

Commit

Permalink
Fix Range __lt__
Browse files Browse the repository at this point in the history
Co-authored-by: Pedro Carrott <43729507+pcarrott@users.noreply.github.com>
  • Loading branch information
Nfsaavedra and pcarrott authored Oct 25, 2023
1 parent b6aa575 commit 9f17b36
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pylspclient/lsp_structs.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ def __gt__(self, __value: object) -> bool:
return self.start >= __value.end

def __lt__(self, __value: object) -> bool:
if not isinstance(__value, Range):
raise TypeError(f"Invalid type for comparison: {type(__value).__name__}")
return self.end <= __value.start

def __le__(self, __value: object) -> bool:
Expand Down

0 comments on commit 9f17b36

Please sign in to comment.