mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
Patch #552433: Special-case tuples. Avoid sub-type checking for lists.
Avoid checks for negative indices and duplicate checks for support of the sequence protocol.
This commit is contained in:
parent
000e37c3c4
commit
01f94bda38
4 changed files with 35 additions and 2 deletions
|
|
@ -765,6 +765,13 @@ determination.
|
|||
and that \var{i} is within bounds.
|
||||
\end{cfuncdesc}
|
||||
|
||||
\begin{cfuncdesc}{PyObject*}{PySequence_ITEM}{PyObject *o, int i}
|
||||
Return the \var{i}th element of \var{o} or \NULL on failure.
|
||||
Macro form of \cfunction{PySequence_GetItem()} but without checking
|
||||
that \cfunction{PySequence_Check(\var{o})} is true and without
|
||||
adjustment for negative indices.
|
||||
\end{cfuncdesc}
|
||||
|
||||
\begin{cfuncdesc}{int}{PySequence_Fast_GET_SIZE}{PyObject *o}
|
||||
Returns the length of \var{o}, assuming that \var{o} was
|
||||
returned by \cfunction{PySequence_Fast()} and that \var{o} is
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue