Re: [Python-Dev] PyObject_CallFunction and 'N' format char

2006-06-25 Thread Gustavo Carneiro
On 6/25/06, Martin v. Löwis [EMAIL PROTECTED] wrote:
 Gustavo Carneiro wrote:
  However, PyObject_CallFunction does _not_
  consume such an object reference, contrary to what I believed for
  years.

 Why do you say that? It certainly does.

  Yes it does.  I could almost swear it didn't last night when I was
debugging this, but today it works as expected.  I guess I was just
sleepy... :P

  Sorry.
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] PyObject_CallFunction and 'N' format char

2006-06-24 Thread Gustavo Carneiro
  Sorry this is slightly offtopic, but I think it's important...

  According to recent experiments tracking down a memory leak, it
seems that PyObject_CallFunction(func, N, object) and
PyObject_CallFunction(func, O, object) are doing exactly the same
thing.  However, documentation says The C arguments are described
using a   Py_BuildValue() style format string..  And of course
Py_BuildValue consumes one object reference, according to the
documentation and practice.  However, PyObject_CallFunction does _not_
consume such an object reference, contrary to what I believed for
years.  God knows how many leaks I may have introduced in my
bindings... :|

  Any comments?
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] PyObject_CallFunction and 'N' format char

2006-06-24 Thread Martin v. Löwis
Gustavo Carneiro wrote:
 However, PyObject_CallFunction does _not_
 consume such an object reference, contrary to what I believed for
 years.

Why do you say that? It certainly does.

Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com