[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: Functions that steal references (Re: [pygame] [patch] minor memory leaks...)



Greg Ewing wrote:

Lenard Lindstrom wrote:

What a function that steals a reference does with an error is undocumented. PyModule_AddObject only steals a referenece when it succeeds. PyList_SetItem and PyTuple_SetItem always steals a reference. The only way to find out which is the case is to examine the Python source code.

Well, that's pretty unsatisfactory. The refcounting
behaviour on failure is just as important as any
other part of the function's spec, and needs to
be documented somewhere.

Hi Greg,

For this one I think your reputation will carry more weight than mine at python.org. Personally I've been cultivating a reputation for submitting bug reports (*) over nitpicky interpretations of the documentation involving obscure corner cases no one cares about anyway.

Lenard


(*) The Python maintainers had the chance to ditch me when they ported bug tracking from SourceForge to their own internal tracker. But they copied my SourceForge account along with those of everyone else who had posted a Python but report. Their mistake.