#14231: warn when preparser redefines Python builtin function
-------------------------------------------------------+--------------------
       Reporter:  ddrake                               |         Owner:  was    
 
           Type:  enhancement                          |        Status:  new    
 
       Priority:  major                                |     Milestone:  
sage-5.8
      Component:  user interface                       |    Resolution:         
 
       Keywords:  symbolic preparser builtin built-in  |   Work issues:         
 
Report Upstream:  N/A                                  |     Reviewers:         
 
        Authors:  Dan Drake                            |     Merged in:         
 
   Dependencies:                                       |      Stopgaps:         
 
-------------------------------------------------------+--------------------

Comment (by ddrake):

 Replying to [comment:3 nbruin]:
 > How about the list:
 > {{{
 > __builtin__.__dict__.keys()
 > }}}


 That's much smarter than my cut-and-paste job. Thanks!


 > In fact, always printing:
 > {{{
 > sage: f(u,v)=u+v
 > Defining symbolic function f and symbolic variables u,v
 > }}}
 > might not be so bad. We're defining new syntax. We can define new
 semantics for that syntax, right?

 I like that. It alleviates the clobbering problem (both for "len" and
 "sin"), and makes it clear to the user what we are doing. I taught the MAA
 PREP workshop on Sage last summer, and defining symbolic functions and
 variables was a sticky point. This would at least give the user a warning
 and something to report ("Sage said it defined a symbolic function...").

 However, fixing all the doctests will turn this into a bit of a patchbomb.
 With the above, there's about 35 files and about 300 doctests to fix. And
 such a change in behavior will require appropriate bikeshedding arguments
 on sage-devel. :)

 I'll post my patch (without doctest fixes) and solicit comments.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14231#comment:4>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to