Ticket #9051: trac_9051_fixes2.patch

File trac_9051_fixes2.patch, 1.6 KB (added by roed, 11 years ago)

Fixes more doctests

  • sage/modular/hecke/algebra.py

    # HG changeset patch
    # User David Roe <roed@math.harvard.edu>
    # Date 1278678518 14400
    # Node ID dae2ed3d86efd77ea2f102111835bfd07ccc0076
    # Parent  d7c6c7793df8a84ebd363ecccf02afadcff83103
    [mq]: trac_9051_fixes2.patch
    
    diff -r d7c6c7793df8 -r dae2ed3d86ef sage/modular/hecke/algebra.py
    a b  
    4343from sage.rings.arith import lcm
    4444from sage.matrix.matrix_space import MatrixSpace
    4545from sage.rings.all import ZZ, QQ
     46from sage.structure.element import Element
    4647
    4748def is_HeckeAlgebra(x):
    4849    r"""
     
    295296            [ 0  1]
    296297        """
    297298        try:
     299            if not isinstance(x, Element):
     300                x = self.base_ring()(x)
    298301            if x.parent() is self:
    299302                return x
    300303            elif hecke_operator.is_HeckeOperator(x):
  • sage/rings/polynomial/polynomial_element.pyx

    diff -r d7c6c7793df8 -r dae2ed3d86ef sage/rings/polynomial/polynomial_element.pyx
    a b  
    613613            while i >= 0:
    614614                result = result * a + self[i](other_args)
    615615                i -= 1
    616         elif not a and a.parent().is_exact(): #without the exactness test we can run into trouble with interval fields.
     616        elif not a and PY_TYPE_CHECK(a, Element) and a.parent().is_exact(): #without the exactness test we can run into trouble with interval fields.
    617617            c = self[0]
    618618            return c + c*a
    619619        elif (d < 4 or d > 50000) and self._compiled is None: