On Mon, Mar 30, 2015 at 5:58 AM, Jeroen Demeyer <jdeme...@cage.ugent.be> wrote:
> The documentation of sage_eval() seems to indicate that this is a feature:
>
> sage: a=5
> sage: sage_eval("a+1")
> ...
> NameError: name 'a' is not defined
>
> Of course you can do
>
> sage: a = 5
> sage: sage_eval("a+1", locals={'a':a})
> 6
>
> But I'm wondering if sage_eval() with globals shouldn't "just work".
> The reason I ask is that replicating this "feature" is more difficult with
> #18083.

As the original author of sage_eval... I totally agree with you.  Or,
at least I can't remember why it doesn't "just work" as you say, and
I've been hit by this problem regularly (certain in the last week!).

That said, maybe there are least needs to be a (default off) option to not use
globals, in case sage_eval were used in library code.

 -- 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 http://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 http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to