Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
moomoohk authored Jun 12, 2024
1 parent ac48a07 commit 3d78a18
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dpath/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __eq__(self, other):
if not isinstance(other, int):
return False

# Based on how Python sequences handle negative indices as described in footnote (3) of https://docs.python.org/3/library/stdtypes.html#common-sequence-operations
return other == int(self) or self.list_length + other == int(self)

def __repr__(self):
Expand Down

0 comments on commit 3d78a18

Please sign in to comment.