Skip to content
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

__copy__ methods for all classes that define "copy" methods (outside of sage.tensor, sage.manifolds) #32453

Open
mkoeppe opened this issue Sep 2, 2021 · 2 comments

Comments

@mkoeppe
Copy link
Member

mkoeppe commented Sep 2, 2021

git grep 'def copy' reveals a number of classes that define ad-hoc copy methods but not __copy__ methods. Hence, they do not implement the copy protocol https://docs.python.org/3/library/copy.html, so copy.copy will resort to pickling/unpickling for making a copy.

For the same in sage.tensor, sage.manifolds, see #32476 instead.

For classes whose instances are immutable, see #13811 instead.

CC: @tscrim @mjungmath @nbruin @kwankyu

Component: refactoring

Issue created by migration from https://trac.sagemath.org/ticket/32453

@mkoeppe mkoeppe added this to the sage-9.5 milestone Sep 2, 2021
@mkoeppe mkoeppe changed the title __copy__ methods for all classes the define "copy" methods __copy__ methods for all classes that define "copy" methods Sep 2, 2021
@kcrisman
Copy link
Member

kcrisman commented Sep 2, 2021

comment:2

It seems this might be a long-awaited followup to #111?

@mkoeppe

This comment has been minimized.

@mkoeppe mkoeppe changed the title __copy__ methods for all classes that define "copy" methods __copy__ methods for all classes that define "copy" methods (outside of sage.tensor, sage.manifolds) Sep 5, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.5, sage-9.6 Dec 14, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 Mar 5, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Aug 31, 2022
@mkoeppe mkoeppe modified the milestones: sage-9.8, sage-9.9 Jan 7, 2023
@mkoeppe mkoeppe removed this from the sage-10.0 milestone Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants