Mercurial > cpython-lru_cache-weakref
diff Doc/api/api.tex @ 18000:ec9343ad1e60 legacy-trunk
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.
| author | Fred Drake <fdrake@acm.org> |
|---|---|
| date | Tue, 29 May 2001 18:51:41 +0000 |
| parents | a2b996c716a1 |
| children | e86d33081bba |
line wrap: on
line diff
--- a/Doc/api/api.tex Tue May 29 18:13:06 2001 +0000 +++ b/Doc/api/api.tex Tue May 29 18:51:41 2001 +0000 @@ -2016,7 +2016,7 @@ Return the \var{i}th element of \var{o}, assuming that \var{o} was returned by \cfunction{PySequence_Fast()}, and that \var{i} is within bounds. The caller is expected to get the length of the sequence by -calling \cfunction{PyObject_Size()} on \var{o}, since lists and tuples +calling \cfunction{PySequence_Size()} on \var{o}, since lists and tuples are guaranteed to always return their true length. \end{cfuncdesc}
