Hi!

At 
http://groups.google.com/group/sage-support/browse_thread/thread/38dfa72aff118470
David Madore asked a question about substitution.

While I tried to answer it, I found the following behaviour of subs()
that, to my knowledge, is technically impossible, given how keyword
arguments are passed in Python:

  sage: R.<x0,x1,x2>=QQ[]
  sage: S = QQ['x0,x1,x2,x3']
  sage: p=S.random_element()
  sage: p.subs(x2=x2)
  2*x1^2 + 85*x0*x3 - 2*x0 - x3

That's fine. But this is not:

  sage: p.subs({'x2':x2})
  Traceback
   ...
  TypeError: keys do not match self's parent

Isn't it the case that actually p.subs(x2=x2) is *equivalent* to p.subs
({'x2':x2}) in Python?

I am totally puzzled.

Best regards,
Simon

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to