Unbinding multiple variables

2005-01-20 Thread Johnny Lin
Hi!

Is there a way to automate the unbinding of multiple variables?  Say I
have a list of the names of all variables in the current scope via
dir().  Is there a command using del or something like that that will
iterate the list and unbind each of the variables?

Thanks much!  (If anyone posts an answer, if you could also cc your
reply to my email [EMAIL PROTECTED], would be much obliged.  Thanks
again!)

Best,
-Johnny
www.johnny-lin.com

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unbinding multiple variables

2005-01-21 Thread Johnny Lin
thanks everyone for the replies!

John Hunter, yep, this is Johnny Lin in geosci :).

re using return:  the problem i have is somewhere in my code there's a
memory leak.  i realize return is supposed to unbind all the local
variables, but since the memory leak is happening despite return, i
thought it might help me track down the leak if i unbound everything
explicitly that i had defined in local scope before i returned.  or if
anyone has recomm. on plugging leaks, would be thankful for any
pointers there too.

my understanding about locals() from the nutshell book was that i
should treat that dictionary as read-only.  is it safe to use it to
delete entries?

thanks again!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Unbinding multiple variables

2005-01-24 Thread Johnny Lin
thanks again for all the help!  especially the advice on ideas of
tracking down the memory leak :).  (sorry for not mentioning it
earlier...i had thought deleting everything might be a quick and dirty
way short-term fix. :P)

best,
-Johnny

-- 
http://mail.python.org/mailman/listinfo/python-list