-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add parameter immutable
to some graph operations in sage/graphs/generic_graph.py
#39280
base: develop
Are you sure you want to change the base?
add parameter immutable
to some graph operations in sage/graphs/generic_graph.py
#39280
Conversation
Documentation preview for this PR (built with commit f75189b; changes) is ready! 🎉 |
I must say that I would like it much better if graphs were immutable by default :-( |
Before debating such drastic change, we must make sure that the entire graph library, including generators, is consistent. |
maybe you could create a function "scream_if_immutable" to avoid repeating ? |
@@ -19440,6 +19472,17 @@ def complement(self): | |||
Graph on 10 vertices | |||
sage: g.complement() | |||
Graph on 10 vertices | |||
|
|||
Check the behavior of parameter `ìmmutable``:: | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missing backtick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (3 times).
I'm adding this idea to my todo list. It should certainly be done also in backends... |
As proposed in #39177, we add parameter
immutable
to (some) graph operations.add_clique
,add_path
, andadd_cycle
to prevent modifying an immutable graphcomplement
to_undirected
behaves as expecteddisjoint_union
to ensure a correct behaviorunion
behaves as expectedThis is only a beginning. More to come in future PRs.
📝 Checklist
⌛ Dependencies