Ticket #7077 (closed defect: fixed)

Opened 4 years ago

Last modified 4 years ago

variables() inconsistently returns a list or tuple

Reported by: jason Owned by: tbd
Priority: minor Milestone: sage-4.2
Component: algebra Keywords:
Cc: mhansen Work issues:
Report Upstream: Reviewers: Karl-Dieter Crisman
Authors: Alex Ghitza Merged in: sage-4.2.alpha1
Dependencies: Stopgaps:

Description

with 4.1.1:

sage: x,y,z=polygens(QQ,'x,y,z')
sage: (x^2).variables()
[x]
sage: x=polygen(QQ)
sage: (x^2).variables()
(x,)

Attachments

trac_7077.patch Download (9.7 KB) - added by AlexGhitza 4 years ago.

Change History

Changed 4 years ago by AlexGhitza

comment:1 Changed 4 years ago by AlexGhitza

  • Status changed from new to needs_review
  • Authors set to Alex Ghitza

There are a number of methods called variables() in the Sage library. The attached patch makes sure that all of them return tuples. (This is what univariate polynomials, and symbolics return.)

comment:2 Changed 4 years ago by kcrisman

  • Status changed from needs_review to positive_review
  • Reviewers set to Karl-Dieter Crisman

Seems to perform as advertised, passes relevant tests, as far as I can tell catches all the cases. Positive review.

comment:3 Changed 4 years ago by mhansen

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-4.2.alpha1
Note: See TracTickets for help on using tickets.