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

Skip to content

Commit d3e0265

Browse files
committed
Document type and semantics of the tp_print return value. Closes SF 606464.
1 parent 47ec141 commit d3e0265

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Doc/api/newtypes.tex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ \section{Type Objects \label{type-structs}}
526526
different output than \member{tp_repr} or \member{tp_str} would.
527527

528528
The print function is called with the same signature as
529-
\cfunction{PyObject_Print()}: \code{tp_print(PyObject *self, FILE
529+
\cfunction{PyObject_Print()}: \code{int tp_print(PyObject *self, FILE
530530
*file, int flags)}. The \var{self} argument is the instance to be
531531
printed. The \var{file} argument is the stdio file to which it is
532532
to be printed. The \var{flags} argument is composed of flag bits.
@@ -535,6 +535,8 @@ \section{Type Objects \label{type-structs}}
535535
should be printed the same way as \member{tp_str} would format it;
536536
when the \constant{Py_PRINT_RAW} flag bit is clear, the instance
537537
should be printed the same was as \member{tp_repr} would format it.
538+
It should return \code{-1} and set an exception condition when an
539+
error occurred during the comparison.
538540

539541
It is possible that the \member{tp_print} field will be deprecated.
540542
In any case, it is recommended not to define \member{tp_print}, but

0 commit comments

Comments
 (0)