Skip to content

add support for immutable=True/False parameter in .canonical_label() and other functions that create a new graph #39177

@maxale

Description

@maxale

Problem Description

Since Graph().canonical_label(immutable=True) gives

TypeError: GenericGraph.canonical_label() got an unexpected keyword argument 'immutable'

one is forced to use an additional .copy() call like Graph().canonical_label().copy(immutable=True) to get an immutable canonical label of a given graph.

Proposed Solution

It will be more straightforward to have immutable= keyword argument supported by any function that creates and returns a new graph (like .canonical_copy()) to save on an extra call to .copy(immutable=True) when the returned graph is needed to be immutable.

Alternatives Considered

N/A

Additional Information

No response

Is there an existing issue for this?

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

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