Skip to content

Commit

Permalink
Implement __lt__() for BaseNode (#115) (#170)
Browse files Browse the repository at this point in the history
(cherry picked from commit 61a56cd)

Co-authored-by: Huba Tuba <57007485+floxay@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and floxay authored May 28, 2024
1 parent 7205343 commit 138ab84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions elastic_transport/_node/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,11 @@ def path_prefix(self) -> str:
def __repr__(self) -> str:
return f"<{self.__class__.__name__}({self.base_url})>"

def __lt__(self, other: object) -> bool:
if not isinstance(other, BaseNode):
return NotImplemented
return id(self) < id(other)

def __eq__(self, other: object) -> bool:
if not isinstance(other, BaseNode):
return NotImplemented
Expand Down

0 comments on commit 138ab84

Please sign in to comment.