@@ -245,7 +245,7 @@ \subsection{Boolean Objects \label{boolObjects}}
245245\end {csimplemacrodesc }
246246
247247\begin {cfuncdesc }{PyObject*}{PyBool_FromLong}{long v}
248- Return a new reference to \constant {Py_True} or \constant {Py_False}
248+ Return a new reference to \constant {Py_True} or \constant {Py_False}
249249 depending on the truth value of \var {v}.
250250\versionadded {2.3}
251251\end {cfuncdesc }
@@ -618,12 +618,24 @@ \subsection{String Objects \label{stringObjects}}
618618 exactly to the format characters in the \var {format} string. The
619619 following format characters are allowed:
620620
621+ % This should be exactly the same as the table in PyErr_Format.
622+ % One should just refer to the other.
623+
624+ % The descriptions for %zd and %zu are wrong, but the truth is complicated
625+ % because not all compilers support the %z width modifier -- we fake it
626+ % when necessary via interpolating PY_FORMAT_SIZE_T.
627+
628+ % %u, %lu, %zu should have "new in Python 2.5" blurbs.
629+
621630 \begin {tableiii }{l|l|l}{member}{Format Characters}{Type}{Comment}
622631 \lineiii {\%\% }{\emph {n/a }}{The literal \% character.}
623632 \lineiii {\% c}{int}{A single character, represented as an C int.}
624633 \lineiii {\% d}{int}{Exactly equivalent to \code {printf("\% d")}.}
634+ \lineiii {\% u}{unsigned int}{Exactly equivalent to \code {printf("\% u")}.}
625635 \lineiii {\% ld}{long}{Exactly equivalent to \code {printf("\% ld")}.}
626- \lineiii {\% zd}{long}{Exactly equivalent to \code {printf("\% zd")}.}
636+ \lineiii {\% lu}{unsigned long}{Exactly equivalent to \code {printf("\% lu")}.}
637+ \lineiii {\% zd}{Py_ssize_t}{Exactly equivalent to \code {printf("\% zd")}.}
638+ \lineiii {\% zu}{ssize_t}{Exactly equivalent to \code {printf("\% zu")}.}
627639 \lineiii {\% i}{int}{Exactly equivalent to \code {printf("\% i")}.}
628640 \lineiii {\% x}{int}{Exactly equivalent to \code {printf("\% x")}.}
629641 \lineiii {\% s}{char*}{A null-terminated C character array.}
@@ -632,6 +644,10 @@ \subsection{String Objects \label{stringObjects}}
632644 guaranteed to start with the literal \code {0x} regardless of
633645 what the platform's \code {printf} yields.}
634646 \end {tableiii }
647+
648+ An unrecognized format character causes all the rest of the format
649+ string to be copied as-is to the result string, and any extra
650+ arguments discarded.
635651\end {cfuncdesc }
636652
637653\begin {cfuncdesc }{PyObject*}{PyString_FromFormatV}{const char *format,
@@ -687,7 +703,7 @@ \subsection{String Objects \label{stringObjects}}
687703 \var {size})}. It must not be deallocated. If \var {string} is a
688704 Unicode object, this function computes the default encoding of
689705 \var {string} and operates on that. If \var {string} is not a string
690- object at all, \cfunction {PyString_AsStringAndSize()} returns
706+ object at all, \cfunction {PyString_AsStringAndSize()} returns
691707 \code {-1} and raises \exception {TypeError}.
692708\end {cfuncdesc }
693709
@@ -1494,7 +1510,7 @@ \subsubsection{Methods and Slot Functions \label{unicodeMethodsAndSlots}}
14941510 Return 1 if \var {substr} matches \var {str}[\var {start}:\var {end}] at
14951511 the given tail end (\var {direction} == -1 means to do a prefix
14961512 match, \var {direction} == 1 a suffix match), 0 otherwise.
1497- Return \code {-1} if an error occurred.
1513+ Return \code {-1} if an error occurred.
14981514\end {cfuncdesc }
14991515
15001516\begin {cfuncdesc }{Py_ssize_t}{PyUnicode_Find}{PyObject *str,
@@ -3013,7 +3029,7 @@ \subsection{DateTime Objects \label{datetime-objects}}
30133029
30143030
30153031\subsection {Set Objects \label {setObjects } }
3016- \sectionauthor {Raymond D. Hettinger}{python@rcn.com}
3032+ \sectionauthor {Raymond D. Hettinger}{python@rcn.com}
30173033
30183034\obindex {set}
30193035\obindex {frozenset}
@@ -3022,8 +3038,8 @@ \subsection{Set Objects \label{setObjects}}
30223038This section details the public API for \class {set} and \class {frozenset}
30233039objects. Any functionality not listed below is best accessed using the
30243040either the abstract object protocol (including
3025- \cfunction {PyObject_CallMethod()}, \cfunction {PyObject_RichCompareBool()},
3026- \cfunction {PyObject_Hash()}, \cfunction {PyObject_Repr()},
3041+ \cfunction {PyObject_CallMethod()}, \cfunction {PyObject_RichCompareBool()},
3042+ \cfunction {PyObject_Hash()}, \cfunction {PyObject_Repr()},
30273043\cfunction {PyObject_IsTrue()}, \cfunction {PyObject_Print()}, and
30283044\cfunction {PyObject_GetIter()})
30293045or the abstract number protocol (including
@@ -3040,7 +3056,7 @@ \subsection{Set Objects \label{setObjects}}
30403056 block of memory for medium and large sized sets (much like list storage).
30413057 None of the fields of this structure should be considered public and
30423058 are subject to change. All access should be done through the
3043- documented API rather than by manipulating the values in the structure.
3059+ documented API rather than by manipulating the values in the structure.
30443060
30453061\end {ctypedesc }
30463062
@@ -3059,7 +3075,7 @@ \subsection{Set Objects \label{setObjects}}
30593075Likewise, the constructor functions work with any iterable Python object.
30603076
30613077\begin {cfuncdesc }{int}{PyAnySet_Check}{PyObject *p}
3062- Return true if \var {p} is a \class {set} object, a \class {frozenset}
3078+ Return true if \var {p} is a \class {set} object, a \class {frozenset}
30633079 object, or an instance of a subtype.
30643080\end {cfuncdesc }
30653081
@@ -3112,7 +3128,7 @@ \subsection{Set Objects \label{setObjects}}
31123128 function does not automatically convert unhashable sets into temporary
31133129 frozensets. Raise a \exception {TypeError} if the \var {key} is unhashable.
31143130 Raise \exception {PyExc_SystemError} if \var {anyset} is not a \class {set},
3115- \class {frozenset}, or an instance of a subtype.
3131+ \class {frozenset}, or an instance of a subtype.
31163132\end {cfuncdesc }
31173133
31183134The following functions are available for instances of \class {set} or
@@ -3134,15 +3150,15 @@ \subsection{Set Objects \label{setObjects}}
31343150 unhashable. Unlike the Python \method {discard()} method, this function
31353151 does not automatically convert unhashable sets into temporary frozensets.
31363152 Raise \exception {PyExc_SystemError} if \var {set} is an not an instance
3137- of \class {set} or its subtype.
3153+ of \class {set} or its subtype.
31383154\end {cfuncdesc }
31393155
31403156\begin {cfuncdesc }{PyObject*}{PySet_Pop}{PyObject *set}
31413157 Return a new reference to an arbitrary object in the \var {set},
31423158 and removes the object from the \var {set}. Return \NULL {} on
31433159 failure. Raise \exception {KeyError} if the set is empty.
31443160 Raise a \exception {SystemError} if \var {set} is an not an instance
3145- of \class {set} or its subtype.
3161+ of \class {set} or its subtype.
31463162\end {cfuncdesc }
31473163
31483164\begin {cfuncdesc }{int}{PySet_Clear}{PyObject *set}
0 commit comments