Hi, isn't this comming from y(3)? Using either
sol1.subs({y(x=3):4}) or y(x) = function('y')(x) makes the warning disappear. Nonetheless I also got lot of questions from students about this warning. Regards, Andrzej. On Mon, Feb 29, 2016 at 11:55 PM, William Stein <wst...@gmail.com> wrote: > Hi, > > Somebody doing differential equations sent me this code, which you can > run in a fresh sage-6.9 session: > > var('x,y') > y = function('y')(x) > eqn = diff(x^2+y^2==25,x) > sol0 = solve(eqn, diff(y,x)) > sol1 = sol0[0].subs({x:3}) > sol1.subs({y(3):4}) > > The *last line* outputs: > > D[0](y)(3) == (-3/4) > DeprecationWarning: Substitution using function-call syntax and > unnamed arguments is deprecated and will be removed from a future > release of Sage; you can use named arguments instead, like EXPR(x=..., > y=...) > See http://trac.sagemath.org/5930 for details. > exec compile(block+'\n', '', 'single') in namespace, locals > > I have some problems with this: > > (1) trac #5930 hasn't been touched in *7 years*, and doesn't mention > subs anywhere. Maybe referencing 5930 was a typo? > > (2) The actual substitution above is *NOT* function-call syntax -- > it's passing in a dictionary, which seems like a very reasonable way > to do substitution in general and should never get deprecated. So why > is that deprecation warning appearing? Is it actually coming from > some other code inside the library? > > (3) The suggestion to "use named arguments instead, like EXPR(x=..., > y=...)" seems confusing to me, since it's impossible to specify y(3) > as a named argument. Also, it assumes that a variable is the same as > its string, which is a bad assumption to make and just begs for bugs; > using a dictionary (or ==) is always safer and should be preferred, > right? > > William > > -- > You received this message because you are subscribed to the Google Groups > "sage-devel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sage-devel+unsubscr...@googlegroups.com. > To post to this group, send email to sage-devel@googlegroups.com. > Visit this group at https://groups.google.com/group/sage-devel. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.