-
-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix bad library uses of var() #18084
Comments
comment:1
I assume you mean
unless someone has gone out of their way to obfuscate the incantation. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Commit: |
Reviewer: Ralf Stephan |
comment:5
Looks good and passes tests in specific main categories. |
comment:6
sage: Sym = SymmetricFunctions(FractionField(QQ['t'])).macdonald()
Traceback (most recent call last):
...
- ValueError: parameter q must be in the base ring
+ TypeError: unable to convert string Is this a regression in terms of the error message, an improvement, or just a change? To me it seems more confusing but maybe that's an appropriate message for users of this material. |
comment:7
Replying to @kcrisman:
Probably all three. In any case, the code is more clear, the exception type ( (As a personal pet peeve, I really dislike excessive exception raising code. Moreover, I prefer a good traceback over a good error message.) |
comment:8
@kcrisman: I can improve the "unable to convert string" error message on a new ticket, but only if somebody (you?) commits to reviewing it. |
comment:9
Until the end of the semester I can commit to nearly nothing, unfortunately, and in any case I don't know that code at all so I'd be reluctant to say what a "good" message would be :-( |
comment:10
Replying to @kcrisman:
Would you be willing to just accept the change on this ticket then? |
comment:11
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
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
and then all other errors are as they should be, instead of raising the message error as previously. |
Changed reviewer from Ralf Stephan to Ralf Stephan, Karl-Dieter Crisman |
comment:12
Replying to @kcrisman:
I get your point. In Python 2, this is difficult to get right. In Python 3, there is https://www.python.org/dev/peps/pep-3134/. |
Dependencies: #18110 |
comment:16
The error message is now
|
comment:17
The change message here lgtm, thanks for updating that. I'll look briefly at #18110 as well. |
comment:18
I guess that was all I needed to review - if it still passes tests I have no further objections. |
comment:19
OK, so positive_review modulo #18110. |
Changed branch from u/jdemeyer/fix_bad_library_uses_if_var__ to |
Sage library code should not use
var()
!Depends on #18110
Component: symbolics
Author: Jeroen Demeyer
Branch/Commit:
52c15f5
Reviewer: Ralf Stephan, Karl-Dieter Crisman
Issue created by migration from https://trac.sagemath.org/ticket/18084
The text was updated successfully, but these errors were encountered: