#18084: Fix bad library uses of var()
-------------------------------------+-------------------------------------
Reporter: jdemeyer | Owner:
Type: enhancement | Status: needs_work
Priority: major | Milestone: sage-6.6
Component: symbolics | Resolution:
Keywords: | Merged in:
Authors: Jeroen Demeyer | Reviewers: Ralf Stephan, Karl-
Report Upstream: N/A | Dieter Crisman
Branch: | Work issues:
u/jdemeyer/fix_bad_library_uses_if_var__| Commit:
Dependencies: | f680be3a9f7da9ca3957a9709997a30917bba687
| Stopgaps:
-------------------------------------+-------------------------------------
Changes (by kcrisman):
* status: needs_review => needs_work
* reviewer: Ralf Stephan => Ralf Stephan, Karl-Dieter Crisman
Comment:
> Moreover, I prefer a good traceback over a good error message.
Well, most people who don't know programming would probably prefer the
opposite.
Actually, upon reading the code I think that this is definitely a
regression. The only reason it complains about a string is because one
doesn't do `var('q')`; surely there is a way to check whether the string
`'q'` will be a variable in the given ring. I agree that the way the
original code was written is not optimal with such a default, but given
that the documentation does directly refer to a parameter `q` (and `t`)
this change is not good. Surely there is some way to at least use
{{{
self.q = Sym.base_ring()(q)
}}}
or something like it to try to convert the string and then give a sensible
error if it's not possible, since this is clearly how it's designed. The
new error message makes it sound like you aren't supposed to use a string,
which is manifestly not the case - especially since the string is the
''default''!
That said, I am happy with anything that raises an error that the user can
actually understand, so I'm not suggesting one has to go back to the
previous. Perhaps
{{{
try:
self.q, self.t do their thing
except TypeError:
do something with SR.var
}}}
and then all other errors are as they should be, instead of raising the
message error as previously.
--
Ticket URL: <http://trac.sagemath.org/ticket/18084#comment:11>
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.
For more options, visit https://groups.google.com/d/optout.