Ticket #12211: trac_12211_fix_bug.2.patch

File trac_12211_fix_bug.2.patch, 1.4 KB (added by davideklund, 17 months ago)

Fix bug, contains doctest (patch made with Sage 4.7.2).

  • sage/schemes/generic/algebraic_scheme.py

    # HG changeset patch
    # User davideklund <daek@kth.se>
    # Date 1324555111 -3600
    # Node ID 4aabf4dfb1288da77d7cdb1c076b0e0aa244bfd4
    # Parent  9e29a3d84c48c399daaf3920bcb8b17273a0e876
    Trac 12211: Fix bug in equation check.
    
    diff --git a/sage/schemes/generic/algebraic_scheme.py b/sage/schemes/generic/algebraic_scheme.py
    a b  
    744744              x^2 - y 
    745745            and Y is defined by: 
    746746              x - y 
     747 
     748        TESTS: 
     749 
     750        The bug reported at #12211 has been fixed:: 
     751 
     752            sage: P.<x, y, z, w> = ProjectiveSpace(3, QQ) 
     753            sage: S = P.subscheme([x]) 
     754            sage: T = P.subscheme([y, z]) 
     755            sage: U = T.complement(S) 
     756            sage: U._check_satisfies_equations([0, 0, 1, 1]) 
     757            True 
    747758        """ 
    748759        coords = list(v) 
    749760        for f in self.__X.defining_polynomials(): 
    750761            if f(coords) != 0: 
    751762                raise TypeError, "Coordinates %s do not define a point on %s"%(v,self) 
    752763        for f in self.__Y.defining_polynomials(): 
    753             if f(coords) == 0: 
    754                 raise TypeError, "Coordinates %s do not define a point on %s"%(v,self) 
    755         return True 
     764            if f(coords) != 0: 
     765                return True 
     766        raise TypeError, "Coordinates %s do not define a point on %s"%(v,self) 
    756767 
    757768    def rational_points(self, F=None, bound=0): 
    758769        """