Ticket #10460 (closed defect: fixed)
Pickling of Functors
|Reported by:||SimonKing||Owned by:||nthiery|
|Report Upstream:||N/A||Reviewers:||Martin Raum|
|Authors:||Simon King||Merged in:||sage-4.7.alpha2|
We used to have:
sage: F = QQ['t'].construction() sage: G = loads(dumps(F)) sage: G == F True sage: G.domain() == F.domain() False sage: G.codomain() is None True
In other words, the cdef'd attributes of the construction functor are lost.
I created a generic pickling method for functors, so that it works a lot better:
sage: F = QQ['t'].construction() sage: G = loads(dumps(F)) sage: G == F True sage: G.domain() == F.domain() True sage: G.codomain() is None False
The patch contains two tests, showing that the problem is solved.
- Status changed from needs_review to positive_review
- Reviewers set to Martin Raum
- Milestone changed from sage-4.7 to sage-4.6.2