On Nov 28, 2:49 pm, Niles <[email protected]> wrote:
> I've noticed the following strange behavior (bug):
>
> sage: A.<a> = PolynomialRing(QQ)
> sage: 3 in A
> True
>
> sage: A2.<a,b> = PolynomialRing(QQ)
> sage: 3 in A2
> False
>
> So apparently "in" for multivariate polynomial rings is slightly
> broken, but I don't know where to look to fix it.

I think it's this code in sage/rings/polynomial/
multi_polynomial_ring_generic.pyx:

    def __contains__(self, x):
        """
        This definition of containment does not involve a natural
        inclusion from rings with less variables into rings with more.
        """
        try:
            return x.parent() == self
        except AttributeError:
            return False

--
John

-- 
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to