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

Commit

Permalink
trac #18346: A 'cdef class' is a 'type', not a 'class'
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanncohen committed May 1, 2015
1 parent 30eb626 commit 25765bb
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/sage/graphs/digraph.py
Expand Up @@ -1127,7 +1127,7 @@ def to_undirected(self, implementation='c_graph', data_structure=None,
Immutable graphs yield immutable graphs (:trac:`17005`)::
sage: DiGraph([[1, 2]], immutable=True).to_undirected()._backend
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
<type 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
"""
if sparse is not None:
if data_structure is not None:
Expand Down
20 changes: 10 additions & 10 deletions src/sage/graphs/generic_graph.py
Expand Up @@ -950,27 +950,27 @@ def copy(self, weighted=None, implementation='c_graph', data_structure=None,
Which backend ?::

sage: G.copy(data_structure="sparse")._backend
<class 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
<type 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
sage: G.copy(data_structure="dense")._backend
<class 'sage.graphs.base.dense_graph.DenseGraphBackend'>
<type 'sage.graphs.base.dense_graph.DenseGraphBackend'>
sage: G.copy(data_structure="static_sparse")._backend
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
<type 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
sage: G.copy(immutable=True)._backend
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
<type 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
sage: G.copy(immutable=True, sparse=True)._backend
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
<type 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
sage: G.copy(immutable=False, sparse=True)._backend
<class 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
<type 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
sage: G.copy(immutable=False, sparse=False)._backend
<class 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
<type 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
sage: Graph(implementation="networkx").copy(implementation='c_graph')._backend
<class 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
<type 'sage.graphs.base.sparse_graph.SparseGraphBackend'>

Fake immutable graphs::

sage: G._immutable = True
sage: G.copy()._backend
<class 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
<type 'sage.graphs.base.sparse_graph.SparseGraphBackend'>
"""
# Which data structure should be used ?
if implementation != 'c_graph':
Expand Down Expand Up @@ -14318,7 +14318,7 @@ def union(self, other):

sage: g = g.copy(immutable=True)
sage: (2*g)._backend
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
<type 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
"""
if (self._directed and not other._directed) or (not self._directed and other._directed):
raise TypeError('both arguments must be of the same class')
Expand Down
2 changes: 1 addition & 1 deletion src/sage/graphs/graph.py
Expand Up @@ -4715,7 +4715,7 @@ def to_directed(self, implementation='c_graph', data_structure=None,
Immutable graphs yield immutable graphs::
sage: Graph([[1, 2]], immutable=True).to_directed()._backend
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
<type 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>
:trac:`17005`::
Expand Down

0 comments on commit 25765bb

Please sign in to comment.