I choose to make the copy return itself, because that's what GF(p) does at the moment anyway, and the field is immutable.
Not sure how much of a hack for me to implement __copy__ and __deepcopy__ instead of __reduce__, but pickling and unpickling at the moment works well anyway (although it returns a different instance)
:memo: Checklist
[x] The title is concise and informative.
[x] The description explains in detail what this PR is about.
[x] I have linked a relevant issue or discussion.
[x] I have created tests covering the changes.
[x] I have updated the documentation and checked the documentation preview.
Documentation preview for this PR (built with commit f7e45486319469418089eed912283901a706ebdc; changes) is ready! :tada:
This preview will update shortly after each push to this PR.
Fixes https://github.com/sagemath/sage/issues/38988
I choose to make the copy return itself, because that's what
GF(p)
does at the moment anyway, and the field is immutable.Not sure how much of a hack for me to implement
__copy__
and__deepcopy__
instead of__reduce__
, but pickling and unpickling at the moment works well anyway (although it returns a different instance):memo: Checklist
:hourglass: Dependencies