[Python-Dev] Memory management in the AST parser & compiler

Greg Ewing greg.ewing at canterbury.ac.nz
Tue Nov 29 23:49:00 CET 2005


Neal Norwitz wrote:
> On 11/28/05, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> 
> > he assumed that FunctionDef would *consume* the references
> > being passed (whether it is successful or not).
> 
> I keep resisting this solution, though I'm not sure why.

One reason for not liking it is that it only works well
when you only call one such function from a given function.
If there are two, you have to worry about not reaching the
second one due to the first one failing, in which case
you need to decref the second one's args yourself.

In the long run it's probably best to stick to the
conventional conventions, which are there for a reason --
they work!

-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg.ewing at canterbury.ac.nz	   +--------------------------------------+


More information about the Python-Dev mailing list