Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 154da9b

Browse files
committed
Fix docstrings for __(get|set|del)slice__ to mention that negative indices are not supported.
1 parent 88957d8 commit 154da9b

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

Objects/typeobject.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4781,11 +4781,17 @@ static slotdef slotdefs[] = {
47814781
SQSLOT("__getitem__", sq_item, slot_sq_item, wrap_sq_item,
47824782
"x.__getitem__(y) <==> x[y]"),
47834783
SQSLOT("__getslice__", sq_slice, slot_sq_slice, wrap_intintargfunc,
4784-
"x.__getslice__(i, j) <==> x[i:j]"),
4784+
"x.__getslice__(i, j) <==> x[i:j]\n\
4785+
\n\
4786+
Use of negative indices is not supported."),
47854787
SQSLOT("__setitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_setitem,
4786-
"x.__setitem__(i, y) <==> x[i]=y"),
4788+
"x.__setitem__(i, y) <==> x[i]=y\n\
4789+
\n\
4790+
Use of negative indices is not supported."),
47874791
SQSLOT("__delitem__", sq_ass_item, slot_sq_ass_item, wrap_sq_delitem,
4788-
"x.__delitem__(y) <==> del x[y]"),
4792+
"x.__delitem__(y) <==> del x[y]i\n\
4793+
\n\
4794+
Use of negative indices is not supported."),
47894795
SQSLOT("__setslice__", sq_ass_slice, slot_sq_ass_slice,
47904796
wrap_intintobjargproc,
47914797
"x.__setslice__(i, j, y) <==> x[i:j]=y"),

0 commit comments

Comments
 (0)