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

Skip to content

Commit fac312f

Browse files
committed
Do not start API descriptions with "Does the same, but ..." -- actually
state *which* other function the current one is like, even if the descriptions are adjacent. Revise the _PyTuple_Resize() description to reflect the removal of the third parameter.
1 parent 0dcea59 commit fac312f

1 file changed

Lines changed: 13 additions & 10 deletions

File tree

Doc/api/api.tex

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3218,7 +3218,8 @@ \subsection{Tuple Objects \label{tupleObjects}}
32183218
\end{cfuncdesc}
32193219

32203220
\begin{cfuncdesc}{PyObject*}{PyTuple_GET_ITEM}{PyObject *p, int pos}
3221-
Does the same, but does no checking of its arguments.
3221+
Like \cfunction{PyTuple_GetItem()}, but does no checking of its
3222+
arguments.
32223223
\end{cfuncdesc}
32233224

32243225
\begin{cfuncdesc}{PyObject*}{PyTuple_GetSlice}{PyObject *p,
@@ -3236,23 +3237,25 @@ \subsection{Tuple Objects \label{tupleObjects}}
32363237

32373238
\begin{cfuncdesc}{void}{PyTuple_SET_ITEM}{PyObject *p,
32383239
int pos, PyObject *o}
3239-
Does the same, but does no error checking, and
3240+
Like \cfunction{PyTuple_SetItem()}, but does no error checking, and
32403241
should \emph{only} be used to fill in brand new tuples.
32413242
\strong{Note:} This function ``steals'' a reference to \var{o}.
32423243
\end{cfuncdesc}
32433244

3244-
\begin{cfuncdesc}{int}{_PyTuple_Resize}{PyObject **p,
3245-
int newsize, int last_is_sticky}
3245+
\begin{cfuncdesc}{int}{_PyTuple_Resize}{PyObject **p, int newsize}
32463246
Can be used to resize a tuple. \var{newsize} will be the new length
32473247
of the tuple. Because tuples are \emph{supposed} to be immutable,
32483248
this should only be used if there is only one reference to the object.
32493249
Do \emph{not} use this if the tuple may already be known to some other
3250-
part of the code. The tuple will always grow or shrink at the end. The
3251-
\var{last_is_sticky} flag is not used and should always be false. Think
3252-
of this as destroying the old tuple and creating a new one, only more
3253-
efficiently. Returns \code{0} on success and \code{-1} on failure (in
3254-
which case a \exception{MemoryError} or \exception{SystemError} will be
3255-
raised).
3250+
part of the code. The tuple will always grow or shrink at the end.
3251+
Think of this as destroying the old tuple and creating a new one, only
3252+
more efficiently. Returns \code{0} on success. Client code should
3253+
never assume that the resulting value of \code{*\var{p}} will be the
3254+
same as before calling this function. If the object referenced by
3255+
\code{*\var{p}} is replaced, the original \code{*\var{p}} is
3256+
destroyed. On failure, returns \code{-1} and sets \code{*\var{p}} to
3257+
\NULL, and raises \exception{MemoryError} or \exception{SystemError}.
3258+
\versionchanged[Removed unused third parameter, \var{last_is_sticky}]{2.2}
32563259
\end{cfuncdesc}
32573260

32583261

0 commit comments

Comments
 (0)