Ticket #10958: trac_10958_bg_constructor_kwds.2.patch

File trac_10958_bg_constructor_kwds.2.patch, 1.2 KB (added by ncohen, 10 years ago)
  • sage/graphs/bipartite_graph.py

    # HG changeset patch
    # User Ryan on Corral Sage VM <iobass@email.com>
    # Date 1300475712 21600
    # Node ID 5e67566201a07edae2e2c5fc6f35bba335943de8
    # Parent  73c28a719cc22f0c90d55f693dcc1791a49f2f51
    trac 10958 -- need to include **kwds in call to Graph constructor when *args is empty
    
    diff -r 73c28a719cc2 -r 5e67566201a0 sage/graphs/bipartite_graph.py
    a b  
    208208        sage: G = graphs.OctahedralGraph()
    209209        sage: N = networkx.make_clique_bipartite(G.networkx_graph())
    210210        sage: B = BipartiteGraph(N)
     211
     212    TESTS:
     213
     214    Make sure we can create a ``BipartiteGraph`` with keywords but no
     215    positional arguments (trac #10958).
     216
     217    ::
     218
     219        sage: B = BipartiteGraph(multiedges=True)
     220        sage: B.allows_multiple_edges()
     221        True
     222       
    211223    """
    212224
    213225    def __init__(self, *args, **kwds):
     
    222234            sage: B = BipartiteGraph(P, partition, check=False)
    223235        """
    224236        if len(args) == 0:
    225             Graph.__init__(self)
     237            Graph.__init__(self, **kwds)
    226238            self.left = set()
    227239            self.right = set()
    228240            return