-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
substitute_function with var argument #17757
Comments
comment:1
See also #22401. |
comment:2
Actually, the docstring of
I assume that it is supposed to replace all occurrences of the function original with the function new, so it should return an error whenever one of the arguments is not a function. However, it is quite useful to substitute an expression for a function (see also https://ask.sagemath.org/question/26114/why-is-basic-arithmetic-disallowed-on-symbolic-functions/):
returns
Note, actually that T is a callable symbolic expression. In the below example, I do a less meaningful substitution, which again gives the right result if I substitute a callable symbolic expression, but if I substitute an expression, it gives the wrong result:
This returns
Only the first result is correct. In the other two, |
comment:3
Replying to @sagetrac-schymans:
Note that the second and third results are accompanied by a deprecation warning:
So, after the deprecation period is over, they will return an error, as it should. |
comment:4
Thanks, I might have turned off warnings in the notebook. However, in the console,the deprecation warning is misleading, as it only asks for named arguments, which isn't even an option for
|
The method would be expected to give a meaningful error when seeing a variable as second argument.
Component: symbolics
Issue created by migration from https://trac.sagemath.org/ticket/17757
The text was updated successfully, but these errors were encountered: