Skip to content

wrong error message when deleting a vertex from a static sparse graph #39270

@dcoudert

Description

@dcoudert

Steps To Reproduce

sage: G = Graph([('a', 1), (1, 2), (2, 3)], immutable=True)
sage: type(G._backend)
<class 'sage.graphs.base.static_sparse_backend.StaticSparseBackend'>

Expected Behavior

sage: G.delete_vertex(1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
ValueError: graph is immutable; please change a copy instead (use function copy())
sage: G.delete_vertex('a')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
ValueError: graph is immutable; please change a copy instead (use function copy())

Actual Behavior

sage: G.delete_vertex(1)
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
ValueError: graph is immutable; please change a copy instead (use function copy())
sage: G.delete_vertex('a')
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
...
TypeError: an integer is required

Additional Information

No response

Environment

  • OS: all
  • Sage Version: 10.6.beta2

Checklist

  • I have searched the existing issues for a bug report that matches the one I want to file, without success.
  • I have read the documentation and troubleshoot guide

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions