summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorMoshe Zadka <moshez@math.huji.ac.il>2000-09-01 09:47:20 (GMT)
committerMoshe Zadka <moshez@math.huji.ac.il>2000-09-01 09:47:20 (GMT)
commit57a5932f13d520ab49fb69f3da84c1e7c463efeb (patch)
treedad50c8ef4bd3b53585d0c4b05baeffbf6670fcc /Doc
parent9bfd2bf5ede8e5d58775180d6867d81ddcdd3594 (diff)
downloadcpython-57a5932f13d520ab49fb69f3da84c1e7c463efeb.zip
cpython-57a5932f13d520ab49fb69f3da84c1e7c463efeb.tar.gz
cpython-57a5932f13d520ab49fb69f3da84c1e7c463efeb.tar.bz2
Update documentation for PyErr_Format, because the function has changed.
Connected to patch 100895
Diffstat (limited to 'Doc')
-rw-r--r--Doc/api/api.tex28
1 files changed, 19 insertions, 9 deletions
diff --git a/Doc/api/api.tex b/Doc/api/api.tex
index 3c313c5..836d677 100644
--- a/Doc/api/api.tex
+++ b/Doc/api/api.tex
@@ -882,15 +882,25 @@ You need not increment its reference count.
\end{cfuncdesc}
\begin{cfuncdesc}{PyObject*}{PyErr_Format}{PyObject *exception,
- const char *format, ...}
-This function sets the error indicator using a printf-style format
-string. The first argument specifies the exception type and the
-second argument specifies the format string for the exception. Any
-subsequent arguments are converted to output by the C library's
-\cfunction{vsprintf()} function. The buffer used internally by
-\cfunction{PyErr_Format()} is 500 bytes long. The caller is
-responsible for guaranteeing that the formatted output does not
-overflow the buffer.
+ const char *format, \moreargs}
+This function sets the error indicator.
+\var{exception} should be a Python object.
+\var{fmt} should be a string, containing format codes, similar to
+\cfunction{printf}. The \code{width.precision} before a format code
+is parsed, but the width part is ignored.
+
+\begin{tableii}{c|l}{character}{Character}{Meaning}
+ \lineii{c}{Character, as an \ctype{int} parameter}
+ \lineii{d}{Number in decimal, as an \ctype{int} parameter}
+ \lineii{x}{Number in hexadecimal, as an \ctype{int} parameter}
+ \lineii{x}{A string, as a \ctype{char *} parameter}
+\end{tableii}
+
+An unrecognized format character causes all the rest of
+the format string to be copied as-is to the result string,
+and any extra arguments discarded.
+
+A new reference is returned, which is owned by the caller.
\end{cfuncdesc}
\begin{cfuncdesc}{void}{PyErr_SetNone}{PyObject *type}