#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 nbruin):

 Replying to [comment:9 kcrisman]:
 > Although I agree that this can be a problem, I wonder if this is too far
 from "standard" Python.  Maybe it's better to teach people that you can
 clobber things, like [http://sagemath.org/doc/prep/Programming.html
 #gotchas-from-names-and-copies here].  I guess I'm agnostic on this
 proposal as of yet, though I suppose `var('y')` does something sort of
 similar - maybe it should have a longer message, too?

 The part that I have always found surprising is that
 {{{
 f(x)=...
 }}}
 ''also'' binds `x`. The typographically similar
 {{{
 f[x]=...
 }}}
 does no such thing. Of course
 {{{
 f,x=...
 }}}
 does bind both so there is precedent of binding multiple names in one
 Python statement, but the construction feels unpythonic to me anyway,
 mainly because semantically the `x` is not there to be defined. It's there
 as a placeholder. That's why I think an (unpythonic) warning might fit the
 (to me unpythonic) syntactic construct. It does clobber our wonderful
 shorthand
 {{{
 _(x,y,z)=0
 }}}
 for
 {{{
 var('x,y,z')
 }}}
 with an ugly warning.

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