"Amir  Michail" <[EMAIL PROTECTED]> writes:
> But dosomestuff can get rid of its reference before it returns (perhaps
> it has a lot more to do before it returns and so you would want to
> garbage collect the parameter object as soon as possible).

That would be so rare and weird that your best bet is to just pass a
boxed object in the odd circumstances where it will make any
difference.  Instead of dosomestuff(x), say dosomestuff([x]).  Then
dosomestuff can mutate the list:

   def dosomestuff(xl):
       x = xl.pop()
       ... do stuff with x ...
       x = None    # free the reference
       ... more stuff...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to