Status: Accepted
Owner: asmeurer
CC: mattpap
Labels: Type-Defect Priority-Medium Polynomial
New issue 2108 by asmeurer: 3/2*x/(y + 1) - z in QQ[x, y, z] failure
http://code.google.com/p/sympy/issues/detail?id=2108
In [3]: 3/2*x/(y + 1) - z in QQ[x, y, z]
---------------------------------------------------------------------------
PolynomialError Traceback (most recent call last)
/Users/aaronmeurer/Documents/python/sympy/sympy/<ipython console> in
<module>()
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/polys/algebratools.py
in __contains__(self, a)
121 """Check if `a` belongs to this domain. """
122 try:
--> 123 self.convert(a)
124 except CoercionFailed:
125 return False
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/polys/algebratools.py
in convert(K1, a, K0)
108
109 if isinstance(a, Basic):
--> 110 return K1.from_sympy(a)
111 except (TypeError, ValueError):
112 pass
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/polys/algebratools.py
in from_sympy(self, a)
1695 def from_sympy(self, a):
1696 """Convert SymPy's expression to `dtype`. """
-> 1697 rep = dict_from_basic(a, self.gens)
1698
1699 for k, v in rep.iteritems():
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/polys/polyutils.py in
dict_from_basic(ex, gens, **args)
249
250 if gens is not None:
--> 251 return _dict_from_basic_if_gens(ex, gens, **args)
252 else:
253 return _dict_from_basic_no_gens(ex, **args)
/Users/aaronmeurer/Documents/python/sympy/sympy/sympy/polys/polyutils.py in
_dict_from_basic_if_gens(ex, gens, **args)
166 coeff.append(factor)
167 else:
--> 168 raise PolynomialError("%s contains an
element of the generators set" % factor)
169
170 monom = tuple(monom)
PolynomialError: 1/(1 + y) contains an element of the generators set
I would have expected False. It also doesn't work in polys11.
--
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.