On Friday, February 5, 2016 at 12:46:54 PM UTC-8, Nathann Cohen wrote:
>
> > Well, the call syntax for polynomials and symbolic expressions really 
> > benefits from arbitrary keywords. 
>
> Yeah, I guess there is nothing wrong with 
> "an_expression.subs(whatever=4)" returning nothing even though 
> 'whatever' is not a variable appearing in an_expression. 
>

It returning nothing would probably be quite bad, and I don't think that's 
what happens. Whether an error or just an_expression unchanged is more 
appropriate depends on the context.
In any case, whether "whatever" is a valid keyword can only be decided at 
runtime, so you're stuck with "**kwargs".

And indeed, in the symbolic ring it's problematic on whether an error 
should be raised. You do want

f = x
g = x^2
f(x=1)^2-g(x=1)

to work, but you would probably expect that

h = f^2-g
h(x=1)

to work too (and in the latter, no x occurs, of course).

However,

sage: f=QQ['x'].0
sage: f(y=0)
x

would probably be better off ending in an error.

-- 
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.

Reply via email to