On Fri, 23 Apr 2010 07:02:23 -0700 (PDT) Nils Bruin <[email protected]> wrote:
> On Apr 22, 11:21 am, Jason Grout <[email protected]> wrote: > > On 04/22/2010 12:33 PM, eric948470 wrote: > > > > > If I declare some variables, and after completing the calculation > > > I don't want them to be variables anymore, how do I make them not > > > variables anymore? > > > > You can just delete them (as with any python object): > > I think this leaks a little, though. The following program fragment > exhibits a linear increase in memory usage: > > i=0 > while true: > i+=1 > varname="a%s"%i > _=var(varname) > _=locals().pop("varname") > > does Pynac clean up completely or does it keep a memorial in place to > honour the previous existence of the symbolic variable? We keep a reference to all the variables in the dictionary sage.symbolic.ring.pynac_symbol_registry. Using weakref here is the right thing, so we should open a ticket for this. Note that speed is very critical on that code path. SR.symbol() gets called many times while converting expressions back from maxima. Thanks. Burcin -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
