best "void" return of a member function

Andreas Otto aotto1968 at onlinehome.de
Mon Apr 20 04:01:40 EDT 2009


Hi,

  I'm writing a native language binding for a library.

        http://libmsgque.sourceforge.net/

  Every native method called by PYTHON have to return
  a PyObject* even if the function itself does not
  return anything.

  I have 2 possibilities for return a PyObject*

        
        1. the first argument of the method function
                -> return self;
        2. an entire new empty object
                -> return Py_BuildValue("");

  Question: what is the best return statement for a "void" function ?

  P.S:  NULL is not allowed, because NULL is returned in the case
        of an "error"


mfg

  Andreas Otto




More information about the Python-list mailing list