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

Skip to content

Commit 96a2a80

Browse files
committed
Users of PySequence_GET_FAST() should get the length of the sequence using
PySequence_Size(), not PyObject_Size(): the later considers the mapping methods as well as the sequence methods, which is not needed here. Either should be equally fast in this case, but PySequence_Size() offers a better conceptual match.
1 parent dc9e7e4 commit 96a2a80

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Doc/api/api.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2016,7 +2016,7 @@ \section{Sequence Protocol \label{sequence}}
20162016
Return the \var{i}th element of \var{o}, assuming that \var{o} was
20172017
returned by \cfunction{PySequence_Fast()}, and that \var{i} is within
20182018
bounds. The caller is expected to get the length of the sequence by
2019-
calling \cfunction{PyObject_Size()} on \var{o}, since lists and tuples
2019+
calling \cfunction{PySequence_Size()} on \var{o}, since lists and tuples
20202020
are guaranteed to always return their true length.
20212021
\end{cfuncdesc}
20222022

0 commit comments

Comments
 (0)