Updates:
Status: Invalid
Comment #6 on issue 1312 by mattpap: provide a way to calculate the
constant coefficient of a polynomial
http://code.google.com/p/sympy/issues/detail?id=1312
This can be done is several different ways, depending on the form of input
and
desired efficiency (e.g. core algorithm, user script):
In [1]: import sympy
In [2]: sympy.sympify('1')
Out[2]: 1
In [3]: sympy.sympify(1)
Out[3]: 1
In [4]: sympy.Integer(1)
Out[4]: 1
In [5]: sympy.S.One
Out[5]: 1
In [6]: sympy.S(1)
Out[6]: 1
Note also that sympy's Integer has different hash from equivalent python's
int:
In [7]: hash(_)
Out[7]: -1303377904
In [8]: hash(1)
Out[8]: 1
That's why sympy.collect(f,x,evaluate=False)[1] fails.
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en
-~----------~----~----~----~------~----~------~--~---