#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:3 nbruin]:
> {{{
> sage: preparse('f(u,v)=u+v')
> '__tmp__=var("u,v"); f = symbolic_expression(u+v).function(u,v);
"Defining f and u,v"'
> }}}
would provide another flavour. Here, essentially the warning is the
"value" of the assignment, so it only gets printed if values of statements
do (i.e., in interactive environments).
If you want to get rid of the quotes in printing:
{{{
class NonQuoteRepr(str):
def __repr__(a):
return a
}}}
and return
{{{
NonQuoteRepr("Defining f and u,v")
}}}
instead. Perhaps we already have a class for representing messages that
does this.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14231#comment:5>
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.