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
replace .copy() with .__copy__() in graphs/graph.py #6522
Comments
comment:1
Note that this has consequences for several files in combinat/. |
comment:2
Note that we will likely need deprecation warnings. See discussion at #6521. |
comment:3
There is one small problem with this. Doing the naive change -
yields:
It's not clear to me how to deal with this; changing the global 'copy' to handle keywords seems ill-advised. On the other hand, there definitely is code (elsewhere) that uses the keywords implementation and sparse, at least in graph_generators.py. |
Author: Karl-Dieter Crisman |
comment:4
I resolved this as best I could. Attached patch should catch all remaining instances of .copy() that don't belong to Python objects that require it (i.e. dicts have only copy, not 'copy'!) |
Based on 4.2.1 |
comment:5
Attachment: trac_6522.patch.gz Hello !!! Could you use the new methods defined in #7515 for the functions you deprecate ? It would ease the work in #7559 :-) |
comment:6
I can't say that I agree with the point of this ticket. Certainly there should be a
works. However, the main use case of the
won't work as
but instead we now need to do:
Which is an ugly, pointless change in API. Why don't we just define |
comment:7
I think that is fine (despite the time it took to do this), because that point makes tons of sense! But perhaps the people who originated this idea in #111 should weigh in before we just add a |
comment:9
Changing the component to graph theory so I can track this: see http://groups.google.com/group/sage-devel/browse_thread/thread/70aacbd1dcc83497 |
Based on 4.3.alpha1 |
comment:10
Attachment: trac_6522-final.patch.gz Okay, here is how I dealt with these issues.
I really, really worked hard to make sure I caught every possible place where this causes problems, and it passes all doctests, but please think hard where it would make a difference. I also hope I won't have to rebase it again :) |
Reviewer: Nathann Cohen, Robert Miller |
comment:11
Ran tests in sage/graphs and sage/combinat. Looks good to me (I think some of those imports are unnecessary, but not a showstopper) |
Merged: sage-4.3.rc1 |
See also #111, where this originates.
CC: @sagetrac-sage-combinat @williamstein @sagetrac-mvngu @aghitza
Component: graph theory
Author: Karl-Dieter Crisman
Reviewer: Nathann Cohen, Robert Miller
Merged: sage-4.3.rc1
Issue created by migration from https://trac.sagemath.org/ticket/6522
The text was updated successfully, but these errors were encountered: