Commit 0c4b511c authored by Tiago Peixoto's avatar Tiago Peixoto
Browse files

Implemet __copy__ in Graph and PropertyMap

parent 808318a6
......@@ -445,6 +445,9 @@ class PropertyMap(object):
the value type is converted to the chosen type."""
return self.get_graph().copy_property(self, value_type=value_type)
def __copy__(self):
return self.copy()
def get_graph(self):
"""Get the graph class to which the map refers."""
g = self.__g()
......@@ -1141,6 +1144,9 @@ class Graph(object):
are also copied."""
return Graph(self)
def __copy__(self):
return self.copy()
def __repr__(self):
# provide more useful information
d = "directed" if self.is_directed() else "undirected"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment