[Python-bugs-list] [ python-Bugs-494007 ] Py_INCREF(Py_None) in documentation

noreply@sourceforge.net noreply@sourceforge.net
Sun, 16 Dec 2001 15:19:35 -0800


Bugs item #494007, was opened at 2001-12-16 15:19
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=494007&group_id=5470

Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Achim Gaedke (achimgaedke)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: Py_INCREF(Py_None) in documentation

Initial Comment:
Since 5 hours I am debugging the pygsl (
http://pygsl.sourceforge.net ) module... The reason: I
forgot to increment the reference counter of Py_None
before returning it. Maybe it is a good idea to
underline this case. The Py_None object is a constant
pointer, maybe some other people do not think about it.

Here is a code example:

static PyObject* my_func(PyObject *self,
                           PyObject *args
                           )
{
  Py_INCREF(Py_None);
  return Py_None;
}

Is it possible, that this case was handled without
reference counter in version 2.0 and older?


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

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