Skip to content

Commit

Permalink
Merge pull request #1063 from chisvi/cell-comparison
Browse files Browse the repository at this point in the history
Implement __eq__ method for `Cell`
  • Loading branch information
lavigne958 authored Jun 17, 2022
2 parents a6b48ea + 930d979 commit 4c2e265
Show file tree
Hide file tree
Showing 3 changed files with 832 additions and 0 deletions.
6 changes: 6 additions & 0 deletions gspread/cell.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ def __repr__(self):
repr(self.value),
)

def __eq__(self, other):
same_row = self.row == other.row
same_col = self.col == other.col
same_value = self.value == other.value
return same_row and same_col and same_value

@property
def row(self):
"""Row number of the cell.
Expand Down
Loading

0 comments on commit 4c2e265

Please sign in to comment.