On Mon, Sep 19, 2016 at 3:49 AM, Jeroen Demeyer <jdeme...@cage.ugent.be>
wrote:

> Hello,
>
> is there anybody who uses the functions reset() or restore() from
> src/sage/misc/reset.pyx
>
> They are meant to "reset" the global state in the interactive session to
> what it was when Sage started up. This seems useless (why not just quit
> Sage and restart it?)


It's orders of magnitude faster than doing that.


> and dangerous (it resets global variables but not all other places
> potentially storing global state).
>

That's only "dangerous" if you expect reset to do the same thing as restart
sage, which is not what it does.


>
> I should also mention that the implementation of these functions is quite
> hacky, relying on Cython's old-style-globals behaviour and using the magic
> sage_mode variable (set on Sage startup).
>

I rewrote both reset and restore for Sage worksheets in SMC


https://github.com/sagemathinc/smc/blob/master/src/smc_sagews/smc_sagews/sage_salvus.py#L2872

In SMC the interactive worksheet has its own dict and has to manage it
itself.  Hence the old-style Cython stuff isn't needed or useful.


> I would prefer to remove these functions (after a deprecation period
> obviously). Thoughts?


They are re-implemented in SMC sage worksheets, so if you remove them from
the Sage command line and jupyter, it will make things even less compatible.

William


>
>
>
> Jeroen.
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to