summaryrefslogtreecommitdiffstats
path: root/Doc/api
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2002-09-10 13:48:01 (GMT)
committerRaymond Hettinger <python@rcn.com>2002-09-10 13:48:01 (GMT)
commitd3e0265373f437902184c1bc37ae45939eb1de7b (patch)
treea7d610b007fc7a0da8103f99243145c78579aa4c /Doc/api
parent47ec1419639b1aa1817860b301c81868284336d1 (diff)
downloadcpython-d3e0265373f437902184c1bc37ae45939eb1de7b.zip
cpython-d3e0265373f437902184c1bc37ae45939eb1de7b.tar.gz
cpython-d3e0265373f437902184c1bc37ae45939eb1de7b.tar.bz2
Document type and semantics of the tp_print return value. Closes SF 606464.
Diffstat (limited to 'Doc/api')
-rw-r--r--Doc/api/newtypes.tex4
1 files changed, 3 insertions, 1 deletions
diff --git a/Doc/api/newtypes.tex b/Doc/api/newtypes.tex
index 4aae617..0f9c9bf 100644
--- a/Doc/api/newtypes.tex
+++ b/Doc/api/newtypes.tex
@@ -526,7 +526,7 @@ Foo_Type.ob_type = &PyType_Type;
different output than \member{tp_repr} or \member{tp_str} would.
The print function is called with the same signature as
- \cfunction{PyObject_Print()}: \code{tp_print(PyObject *self, FILE
+ \cfunction{PyObject_Print()}: \code{int tp_print(PyObject *self, FILE
*file, int flags)}. The \var{self} argument is the instance to be
printed. The \var{file} argument is the stdio file to which it is
to be printed. The \var{flags} argument is composed of flag bits.
@@ -535,6 +535,8 @@ Foo_Type.ob_type = &PyType_Type;
should be printed the same way as \member{tp_str} would format it;
when the \constant{Py_PRINT_RAW} flag bit is clear, the instance
should be printed the same was as \member{tp_repr} would format it.
+ It should return \code{-1} and set an exception condition when an
+ error occurred during the comparison.
It is possible that the \member{tp_print} field will be deprecated.
In any case, it is recommended not to define \member{tp_print}, but