[Python-bugs-list] [ python-Bugs-440041 ] Inconsistencies in C API calls
noreply@sourceforge.net
noreply@sourceforge.net
Fri, 10 Aug 2001 12:29:07 -0700
Bugs item #440041, was opened at 2001-07-10 06:31
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=440041&group_id=5470
Category: None
Group: None
>Status: Closed
>Resolution: Wont Fix
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
>Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Inconsistencies in C API calls
Initial Comment:
Hello,
While writing a code generator for calling Python
functions from C, I encountered some inconsistencies in
a few calls in C API interface:
- PyLong_AS_LONG() does not exist, while
PyInt_AS_LONG() does
- The return type of PyList_SET_ITEM() is different
from 'void PyTuple_SET_ITEM()
I also found a number of documentation bugs, but those
are reported in report #440037
Albert
----------------------------------------------------------------------
>Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-08-10 12:29
Message:
Logged In: YES
user_id=3066
The return values from PyList_SET_ITEM() and
PyTuple_SET_ITEM() are not meant to be used, but both
evaluate to the type of the third argument.
PyInt_AS_LONG is guaranteed to succeed as long as the
argument is an integer object; PyLong_AS_LONG() cannot make
the parallel guarantee, so they would not be parallel
anyway. (Remember, a PyLong is unbounded.)
There's no need to change any of these APIs.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=440041&group_id=5470