PQueue and Python 2.5

Giovanni Bajo noway at ask.me
Sat Jan 20 13:57:27 CET 2007

On 20/01/2007 11.29, Martin v. Löwis wrote:

>> I haven't got a clue how to investigate this, but I would be willing to
>> help if someone has any ideas.
> There are a number of problems in this code; the most significant one is
> the incorrect usage of memory management API. In pqueue_dealloc, the
> call PyMem_DEL(pqp) should read PyObject_DEL(pqp), as the object was
> allocated with PyObject_NEW. Because this was a common error once,
> Python up to 2.4 detected that error and silently corrected it (at some
> runtime cost); Python 2.5 now has removed this work-around.

And by the way, this is also a FAQ:


and even explained in the Misc/NEWS of Python 2.5.
Giovanni Bajo

More information about the Python-list mailing list