Opened 4 months ago

## #28421 new enhancement

# Fix weighted term order construction

Reported by: | bruno | Owned by: | |
---|---|---|---|

Priority: | major | Milestone: | sage-8.9 |

Component: | algebra | Keywords: | |

Cc: | Merged in: | ||

Authors: | Bruno Grenet | Reviewers: | |

Report Upstream: | N/A | Work issues: | |

Branch: | weighted_term_orders | Commit: | |

Dependencies: | Stopgaps: |

### Description

Currently, weighted term orders that are not given a tuple or a list as parameter behave strangely (and this causes confusion, cf on Ask¹):

sage: t = TermOrder('wdegrevlex', 2) sage: t Weighted degree reverse lexicographic term order sage: t.is_weighted_degree_order() False sage: P.<x> = PolynomialRing(QQ, 1, order=t) sage: x.degree() 1

In this ticket, we change the behavior as follows:

sage: t = TermOrder('wdegrevlex', 2) sage: t Weighted degree reverse lexicographic term order with weights (2,) sage: t.is_weighted_degree_order() True sage: P.<x> = PolynomialRing(QQ, 1, order=t) sage: x.degree() 2

Note: Another possibility is to raise an Exception when an integer is given rather than a tuple/list. I think the proposed solution is more useful to the users.

¹ The Ask question uncovers two distinct problems, the second one is fixed in #28420.

**Note:**See TracTickets for help on using tickets.