Re: PROPOSAL: A Generic Python Object Interface for Python C Modules

Jim Fulton (jfulton@dsjfqvarsa.er.usgs.GOV)
Mon, 27 Feb 1995 18:35:04 GMT

Groan. I forgot to change some text in this proposal that described
old memory management behavior:

>>>>> "Jim" == Jim Fulton <jfulton@dsjfqvarsa.er.usgs.GOV> writes:
In article <JFULTON.95Feb27132143@dsjfqvarsa.er.usgs.GOV>
jfulton@dsjfqvarsa.er.usgs.GOV (Jim Fulton ) writes:

> int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v)

> Map the object, key, to the value, v. The reference count of
> v is unchanged, however, the reference count of the object
> that v replaces is decremented. (Does key replace an object?)
> Returns 1 on success, 0 on failure. This is the equivalent
> of the Python statement: o[key]=v.

Should be:

int PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v)

Map the object, key, to the value, v. Returns 1 on success,
0 on failure. This is the equivalent of the Python
statement: o[key]=v.

> int PySequence_SetItem(PyObject *o, int i, PyObject *v)

> Assign object v to the ith element of o. The reference
> count of v is unchanged, however, the reference count of the
> object that v replaces is decremented. Returns 1 on success,
> 0 on failure. This is the equivalent of the Python
> statement, o[i]=v.

Should be:

> int PySequence_SetItem(PyObject *o, int i, PyObject *v)

> Assign object v to the ith element of o. The reference
> count of v is unchanged, however, the reference count of the
> object that v replaces is decremented. Returns 1 on success,
> 0 on failure. This is the equivalent of the Python
> statement, o[i]=v.

int PySequence_SetItem(PyObject *o, int i, PyObject *v)

Assign object v to the ith element of o. Returns 1 on
success, 0 on failure. This is the equivalent of the Python
statement, o[i]=v.

> PyObject *PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)

> Map the object, key, to the value, v. The reference count of
> v is unchanged, however, the reference count of the object
> that v replaces is decremented. (Does key replace an object?)
> Returns 1 on success, 0 on failure. This is the equivalent
> of the Python statement, o[key]=v.

Should be:

PyObject *PyMapping_SetItemString(PyObject *o, char *key, PyObject *value)

Map the object, key, to the value, v. Returns 1 on success,
0 on failure. This is the equivalent of the Python
statement: o[key]=v.

--
-- Jim Fulton      jfulton@mailqvarsa.er.usgs.gov    (703) 648-5622
                   U.S. Geological Survey, Reston VA  22092 
This message is being posted to obtain or provide technical information
relating to my duties at the U.S. Geological Survey.