#13811: LazyFamily cannot be copied if it can't be pickled
--------------------------------------------+-------------------------------
Reporter: cnassau | Owner: was
Type: defect | Status: needs_review
Priority: minor | Milestone: sage-5.5
Component: pickling | Resolution:
Keywords: LazyFamily, copy, pickle | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Christian Nassau | Merged in:
Dependencies: | Stopgaps:
--------------------------------------------+-------------------------------
Comment (by nthiery):
Replying to [comment:5 cnassau]:
> I '''do''' think that user code can expect that `copy(any_sage_object)`
does not throw an error. Maybe `LazyFamily.__copy__(self)` should just
return `self`? This would be in accordance with
>
> {{{
> sage: copy(Integers()) is Integers()
> True
> }}}
Yes, it would make sense to have copy(x) return x for all immutable
objects in Sage. I am not sure how to achieve this though: we do not
(yet?) have a class for providing code for all immutable objects in Sage,
and I would not want to force every relevant class to reimplement a
trivial __copy__ method.
For the case at hand (families), maybe one could add a method
Parent.__copy__ returning `self`? As far as I can tell, parents are
required to be immutable anyway. But one should double check this.
Cheers,
Nicolas
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13811#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.