#6522: replace .copy() with .__copy__() in graphs/graph.py
------------------------------+---------------------------------------------
Reporter: AlexGhitza | Owner: was
Type: enhancement | Status: new
Priority: minor | Milestone: sage-4.3
Component: user interface | Keywords:
Work_issues: | Author:
Reviewer: | Merged:
------------------------------+---------------------------------------------
Comment(by kcrisman):
There is one small problem with this. Doing the naive change -
{{{
def __copy__(self, implementation='networkx', sparse=None):
}}}
yields:
{{{
sage: g=Graph({0:[0,1,1,2]})
sage: copy(g)
Looped multi-graph on 3 vertices
sage: g.__copy__(sparse=True)
Looped multi-graph on 3 vertices
sage: copy(g,sparse=True)
---------------------------------------------------------------------------
TypeError: copy() got an unexpected keyword argument 'sparse'
}}}
It's not clear to me how to deal with this; changing the global 'copy' to
handle keywords seems ill-advised. On the other hand, there definitely is
code (elsewhere) that uses the keywords implementation and sparse, at
least in graph_generators.py.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/6522#comment:3>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=.