This is a known issue.  Unfortunately, it seems the pickle does not
work for Function.  See
http://code.google.com/p/sympy/issues/detail?id=1198.

Any ideas on how to fix this?

Aaron Meurer

On Fri, Jul 1, 2011 at 9:53 AM, Mani Chandra <[email protected]> wrote:
> There is a problem with that procedure when I'm trying to save a function.
> In [70]: a = Function('a')
> In [71]: pickle.dump(a, file('a.dat', 'w'))
> ---------------------------------------------------------------------------
> PicklingError                             Traceback (most recent call last)
> /home/mc/test.py in <module>()
> ----> 1
>       2
>       3
>       4
>       5
> /usr/lib/python2.7/pickle.pyc in dump(obj, file, protocol)
>    1368
>    1369 def dump(obj, file, protocol=None):
> -> 1370     Pickler(file, protocol).dump(obj)
>    1371
>    1372 def dumps(obj, protocol=None):
> /usr/lib/python2.7/pickle.pyc in dump(self, obj)
>     222         if self.proto >= 2:
>     223             self.write(PROTO + chr(self.proto))
> --> 224         self.save(obj)
>     225         self.write(STOP)
>     226
> /usr/lib/python2.7/pickle.pyc in save(self, obj)
>     293             issc = 0
>     294         if issc:
> --> 295             self.save_global(obj)
>     296             return
>     297
> /usr/lib/python2.7/pickle.pyc in save_global(self, obj, name, pack)
>     746             raise PicklingError(
>     747                 "Can't pickle %r: it's not found as %s.%s" %
> --> 748                 (obj, module, name))
>     749         else:
>     750             if klass is not obj:
> PicklingError: Can't pickle a: it's not found as sympy.core.function.a
>
> --
> You received this message because you are subscribed to the Google Groups
> "sympy" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/sympy/-/TUayQHfdoGYJ.
> 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/sympy?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sympy" 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/sympy?hl=en.

Reply via email to