#10962: Set_PythonType objects are not picklable
-------------------------------------+-------------------------------------
Reporter: stumpc5 | Owner: was
Type: defect | Status: needs_info
Priority: major | Milestone: sage-6.5
Component: pickling | Resolution:
Keywords: | Merged in:
Authors: Vincent | Reviewers: Jeroen Demeyer
Delecroix, Jeroen Demeyer | Work issues:
Report Upstream: N/A | Commit:
Branch: | edf526e2a9b181c058620e1b42b1b378c37d99a7
u/jdemeyer/ticket/10962 | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Changes (by {'newvalue': u'Vincent Delecroix, Jeroen Demeyer', 'oldvalue':
u'Vincent Delecroix'}):
* status: needs_review => needs_info
* author: Vincent Delecroix => Vincent Delecroix, Jeroen Demeyer
Comment:
Replying to [comment:23 jdemeyer]:
> This finally passes all doctests. We just need somebody to review my
last two commits:
> *
[http://git.sagemath.org/sage.git/commit/?id=4b5c3732a910b99b8f43b5b4eb0da13c8f1c7f27]
> *
[http://git.sagemath.org/sage.git/commit/?id=edf526e2a9b181c058620e1b42b1b378c37d99a7]
I am fine with the first one. But the result of `.parent()` should be a
parent isn't it? Why not
{{{
def parent(self):
return Set_PythonType(type(self))
}}}
On the other hand, the `MaximaWrapper` does not inherit from `Element`
which is perfectly fine. I am worried that we need this method. The bug
for me is the following behavior
{{{
sage: parent(sin(1).maxima_methods())
parent(sin(1))
}}}
which should just behave like
{{{
sage: parent(int(1))
<type 'int'>
}}}
(which is also strange but perfectly fine if uniform).
The reason is that there is a too permissive `__getattr__` in
`MaximaWrapper` which never raises `AttributeError`. I would really prefer
that:
- either we move your solution at the level of `SageObject`
- or we hack `__getattr__` of `MaximaWrapper`
Vincent
--
Ticket URL: <http://trac.sagemath.org/ticket/10962#comment:25>
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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.