Ticket #7294: trac_7294-fix.patch

File trac_7294-fix.patch, 1.4 KB (added by mhansen, 10 years ago)
  • sage/graphs/graph.py

    # HG changeset patch
    # User Mike Hansen <mhansen@gmail.com>
    # Date 1260899495 28800
    # Node ID 3b79b0bbc70225a44af608cc13daef3e466592bd
    # Parent  2b2706c80635d55d6273e48b90eed1fc93de2bc4
    Minor fixes for #7294
    
    diff --git a/sage/graphs/graph.py b/sage/graphs/graph.py
    a b  
    1052510525        Is there a perfect matching in an even cycle ?
    1052610526
    1052710527            sage: g = graphs.CycleGraph(6)
    10528             sage: bounds = lambda x : [1,1]
    10529             sage: m=g.degree_constrained_subgraph(bounds=bounds) # optional - requires GLPK or CBC
    10530             sage: m.size()
     10528            sage: bounds = lambda x: [1,1]
     10529            sage: m = g.degree_constrained_subgraph(bounds=bounds) # optional - requires GLPK or CBC
     10530            sage: m.size() #optional
    1053110531            3
    1053210532        """
    1053310533
     
    1053810538
    1053910539        reorder = lambda x: (min(x[0],x[1]),max(x[0],x[1]),x[2])
    1054010540
    10541         if bounds == None:
     10541        if bounds is None:
    1054210542            raise ValueError,"The `bounds` keyword can not be equal to None"
    1054310543        elif isinstance(bounds,dict):
    10544             f_bounds = lambda x : bounds[x]
     10544            f_bounds = lambda x: bounds[x]
    1054510545        else:
    1054610546            f_bounds = bounds
    1054710547           
    1054810548
    1054910549        if self.weighted():
    10550             weight = lambda x: x[2] if x[2] != None else 1
     10550            weight = lambda x: x[2] if x[2] is not None else 1
    1055110551        else:
    1055210552            weight = lambda x: 1
    1055310553