Ben C wrote: > On 2006-05-09, Ben C <[EMAIL PROTECTED]> wrote: >> def clearall(): >> all = [var for var in globals() if "__" not in (var[:2], var[-2:])] >> for var in all: >> del globals()[var] >> >> since I think magic things always start and end with __. > > Oops, got that wrong anyway: > > should be: > > all = [var for var in globals() if (var[:2], var[-2:]) != ("__", "__")]
You can also add and var != "clearall" :-) -- Grégoire -- http://mail.python.org/mailman/listinfo/python-list