[Python-bugs-list] [ python-Bugs-606464 ] tp_print return semantics

noreply@sourceforge.net noreply@sourceforge.net
Tue, 10 Sep 2002 05:47:29 -0700


Bugs item #606464, was opened at 2002-09-08 16:50
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=606464&group_id=5470

Category: Documentation
Group: Python 2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: David Abrahams (david_abrahams)
Assigned to: Raymond Hettinger (rhettinger)
Summary: tp_print return semantics

Initial Comment:
There's no description of the meaning of the return value 
from the tp_print field.

----------------------------------------------------------------------

>Comment By: David Abrahams (david_abrahams)
Date: 2002-09-10 07:47

Message:
Logged In: YES 
user_id=52572

I think it would be much better to follow the example of 
tp_compare, which says:

It should return -1 and set an exception condition when an 
error occurred during the comparison

----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2002-09-10 07:36

Message:
Logged In: YES 
user_id=80475

Does the attached patch fit the bill?

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-09-10 06:44

Message:
Logged In: NO 

No, that's documentation for a functin called PyObject_Print.
Yes, it should be documented here: 
http://www.python.org/dev/doc/devel/api/type-structs.html#l2h-
824



----------------------------------------------------------------------

Comment By: Raymond Hettinger (rhettinger)
Date: 2002-09-10 00:28

Message:
Logged In: YES 
user_id=80475

In section 6.1 of the C API manual:

"""
int PyObject_Print( PyObject *o, FILE *fp, int flags) 
Print an object o, on file fp. Returns -1 on error. 
"""

Is there another place it should be documented?

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=606464&group_id=5470