#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  |          Keywords:  symbolic preparser builtin 
built-in
Work issues:                  |   Report Upstream:  N/A                         
       
  Reviewers:                  |           Authors:                              
       
  Merged in:                  |      Dependencies:                              
       
   Stopgaps:                  |  
------------------------------+---------------------------------------------
 At https://groups.google.com/forum/?fromgroups=#!topic/sage-
 devel/EQzNB7vkN3o , a user tries this:
 {{{
 sage: t=(1,2,3)
 sage: type(t)
 tuple
 sage: len(t)
 3
 sage: len(t)=4
 sage: t
 t
 sage: type(t)
 sage.symbolic.expression.Expression
 }}}

 This strange behavior is because of the preparser:
 {{{
 sage: preparse('len(t) = 4')
 '__tmp__=var("t"); len = symbolic_expression(Integer(4)).function(t)'
 }}}

 I propose that when the preparser is about to redefine a Python built-in
 function, we issue a warning. This will allow users to clobber the
 builtins, but also tell them they are possibly doing something unwise.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14231>
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