# polynomial ring instance check

Hi there, folks. How do i check if something is an instance of a polynomial ring (univariate or multivariate)?

polynomial ring instance check

add a comment

2

First of all, do you really need to? Just allow any input, if it does not have the methods you are calling then you will get a suitable `AttributeError`

exception thrown. AKA duck-typing.

If you are sure that you actually have to check the type, use the convenience functions:

```
sage: from sage.rings.polynomial.polynomial_ring import is_PolynomialRing
sage: is_PolynomialRing('string')
False
sage: from sage.rings.polynomial.multi_polynomial_ring import is_MPolynomialRing
sage: is_MPolynomialRing('string')
False
```

Asked: **
2012-01-18 10:32:10 -0500
**

Seen: **87 times**

Last updated: **Jan 18 '12**

How would I Factor Polynomials over complex numbers?

Expand a polynomial into Schubert basis

complex, real, common ring, crash in 'vector' constructor

irreducibility of a polynomial

Factoring bivariate polynomials w.r.t. a single variable

Write sage code to find the Bezout coefficients of two polynomials b(x), c(x)

given a list of coefficients how can I get a polynomial

Linear code over a finite ring

Several variables, consider polynomail as polynomial only of $X$, group coefficients

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.