Status: Accepted
Owner: j.yehde...@gmail.com
Labels: Type-Defect Priority-Medium

New issue 2498 by j.yehde...@gmail.com: as_ordered_terms only works for "lex" and "rev-lex"
http://code.google.com/p/sympy/issues/detail?id=2498

Consider the following:

In [3]: f=x**4+y**2*x+y+2
In [4]: f.as_ordered_terms(order="grevlex")
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)

This is because .as_ordered_terms calls the key function from _parse_order, where the following is done (line 241 in core/expr.py):

  monom = [ -m for m in monom_key(monom) ]

monom_key is either monomial_key_lex, monomial_key_grlex or monomial_key_grevlex from polys/monomialtools.py, however only monomial_key_lex returns a tuple of integers, the other two both return a tuple where one element is a tuple itself, which gives the error.

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" group.
To post to this group, send email to sympy-issues@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-issues+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sympy-issues?hl=en.

Reply via email to