On Mar 6, 2013, at 10:32 AM, Dan Drake <ddr...@pugetsound.edu> wrote:

> Recently in a different thread here [1], someone accidentally clobbered
> a Python builtin with a symbolic function:
> 
> sage: t = (1,2,3)
> sage: len(t) = 4
> 
> ...which overwrites t and the Python builtin len. 
> 
> I have a patch at #14231 that, at Nils Bruin's suggestion, *always*
> prints when defining a symbolic function via the preparser:
> 
> sage: f(u,v)=u+v
> Defining symbolic function f and symbolic variables u,v
> 
> This makes it easier to catch typos such as "sin(t) = 0" when you want
> "sin(t) == 0". This seems reasonable to me; I taught the MAA PREP
> workshop on Sage last summer, and symbolic functions and variables were
> a tricky concept. The new behavior would at least tell the user what the
> preparser is doing behind the scenes.
> 
> This is a change in behavior, though, and will require fixing a lot of
> doctests. Comments welcome.

Would it be possible to print the warning only if the session is interactive.  
Then you wouldn't have to change doctests and wouldn't have to see the warning 
when running scripts.

-Ivan

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to