Re: is it necessary to DECREF arguments?

Sjoerd Mullender (Sjoerd.Mullender@cwi.nl)
Fri, 23 Sep 1994 09:45:40 +0200

On Thu, Sep 22 1994 Andy Bensky wrote:

> In a C function that extracts its arguments using getargs(), if any of the
> arguments are complex objects ("O" format) do they need to be DECREF()'d
> before returning control to the interpreter?

No. Getargs does not do an INCREF on any of the arguments, so if you
want to save an object you have to do an INCREF yourself. This means
that if you don't want to save the object, you should not do a DECREF.

Sjoerd Mullender, CWI, P.O. Box 94079, 1090 GB Amsterdam, The Netherlands
E-Mail: Sjoerd.Mullender@cwi.nl; Phone: +31 20 592 4127; Fax: +31 20 592 4199
URL: <http://www.cwi.nl/cwi/people/Sjoerd.Mullender.html>