Skip to content

Commit 3d78a18

Browse files
authored
Add comment
1 parent ac48a07 commit 3d78a18

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

dpath/types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def __eq__(self, other):
2121
if not isinstance(other, int):
2222
return False
2323

24+
# 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
2425
return other == int(self) or self.list_length + other == int(self)
2526

2627
def __repr__(self):

0 commit comments

Comments
 (0)