at
http://trac.sagemath.org/sage_trac/ticket/11764
Paul Zimmermann writes:
"""
for univariate polynomials we have the class Polynomial:
sage: R.<x> = QQ[]
sage: isinstance(x+1, Polynomial)
True
However for multivariate polynomials we have to write:
sage: R.<x,y> = QQ[]
sage: isinstance(x+y, sage.rings.polynomial.multi_polynomial.MPolynomial)
True
I suggest MPolynomial is defined as an alias for
sage.rings.polynomial.multi_polynomial.MPolynomial so that we can
simply write:
sage: R.<x,y> = QQ[]
sage: isinstance(x+y, MPolynomial)
True
"""
I suggested this needs a discussion on [sage-devel] because it's about
adding *more* stuff to the global namespace, while we try to keep that
to a minimum.
Thoughts?
Martin
--
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://www.informatik.uni-bremen.de/~malb
_jab: martinr...@jabber.ccc.de
Random Thoughts: Since we banned using "is_MPolynomial", and we do
have Polynomial in the global namespace, I can't see an alternative to
having MPolynomial. That said, it's perhaps bad that we have
Polynomial in the global namespace. I wonder how many people have
done:
sage: Polynomial(2)
boom!
sage: Polynomial([1,2,3])
boom!
sage: Polynomial(QQ,[1,2,3])
boom!
sage: Polynomial?
pages, with nothing about how to make a polynomial using "the
Polynomial command"...
-- William