On 08/08/2018 00:26, John Cremona wrote:
On 7 August 2018 at 20:56, Vincent Delecroix <[email protected]>
wrote:

The global binomial function is to be blamed. The one
in arith works fine

sage: R.<q> = ZZ[]
sage: sage.arith.all.binomial(q,2)
1/2*q^2 - 1/2*q
sage: sage.arith.all.binomial(q,2).parent()
Univariate Polynomial Ring in q over Rational Field


Thanks.  So if I put

from sage.arith.all import binomial

at the top then all works as expected.
The example you gave will work but not the following one

sage: var('m,n')
(m, n)
sage: binomial(m,n)
binomial(m, n)

This does leave the questions as to
why the symbolic version is imported but not this one.

The above example is the answer. You might want to manipulate
binomial as an abstract mathematical function.

 Ideally the global
function would test the type / parent of the first input and use that to
decide which function to call.  The current practice will be a cause of
bugs.

Did you fill a ticket on trac for the buggy type behavior?

Vincent

--
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to