Skip to content
This repository was archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
trac #15681: New doctest for name() on immutable graphs
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanncohen committed Jan 16, 2014
1 parent 5620ec5 commit 7e9d208
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/sage/graphs/generic_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2304,6 +2304,17 @@ def name(self, new=None):
Graph on 10 vertices
sage: G.name()
''

Name of an immutable graph :trac:`15681` ::

sage: g = graphs.PetersenGraph()
sage: gi = g.copy(immutable=True)
sage: gi.name()
'Petersen graph'
sage: gi.name("Hey")
Traceback (most recent call last):
...
NotImplementedError: An immutable graph does not change name
"""
if new is None:
return getattr(self, '_name', "")
Expand Down

0 comments on commit 7e9d208

Please sign in to comment.