Status: Valid
Owner: ----
CC: [email protected]
Labels: Type-Defect Priority-Medium Polynomial

New issue 3778 by [email protected]: AGCA objects are not picklable
http://code.google.com/p/sympy/issues/detail?id=3778

In [14]: pickle.dumps(QQ[x, y].ideal(1 - x))
---------------------------------------------------------------------------
PicklingError                             Traceback (most recent call last)
<ipython-input-14-3b65e03ebb2b> in <module>()
----> 1 pickle .dumps (QQ [x ,y ].ideal (Integer (1 )-x ))

/sw/lib/python2.7/pickle.pyc in dumps(obj, protocol)
   1372 def dumps(obj, protocol=None):
   1373     file = StringIO()
-> 1374     Pickler(file, protocol).dump(obj)
   1375     return file.getvalue()
   1376

/sw/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

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    329
    330         # Save the reduce() output and finally memoize the object
--> 331         self.save_reduce(obj=obj, *rv)
    332
    333     def persistent_id(self, obj):

/sw/lib/python2.7/pickle.pyc in save_reduce(self, func, args, state, listitems, dictitems, obj)
    417
    418         if state is not None:
--> 419             save(state)
    420             write(BUILD)
    421

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    284         f = self.dispatch.get(t)
    285         if f:
--> 286             f(self, obj) # Call unbound method with explicit self
    287             return
    288

/sw/lib/python2.7/pickle.pyc in save_dict(self, obj)
    647
    648         self.memoize(obj)
--> 649         self._batch_setitems(obj.iteritems())
    650
    651     dispatch[DictionaryType] = save_dict

/sw/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
    661             for k, v in items:
    662                 save(k)
--> 663                 save(v)
    664                 write(SETITEM)
    665             return

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    329
    330         # Save the reduce() output and finally memoize the object
--> 331         self.save_reduce(obj=obj, *rv)
    332
    333     def persistent_id(self, obj):

/sw/lib/python2.7/pickle.pyc in save_reduce(self, func, args, state, listitems, dictitems, obj)
    417
    418         if state is not None:
--> 419             save(state)
    420             write(BUILD)
    421

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    284         f = self.dispatch.get(t)
    285         if f:
--> 286             f(self, obj) # Call unbound method with explicit self
    287             return
    288

/sw/lib/python2.7/pickle.pyc in save_dict(self, obj)
    647
    648         self.memoize(obj)
--> 649         self._batch_setitems(obj.iteritems())
    650
    651     dispatch[DictionaryType] = save_dict

/sw/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
    661             for k, v in items:
    662                 save(k)
--> 663                 save(v)
    664                 write(SETITEM)
    665             return

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    329
    330         # Save the reduce() output and finally memoize the object
--> 331         self.save_reduce(obj=obj, *rv)
    332
    333     def persistent_id(self, obj):

/sw/lib/python2.7/pickle.pyc in save_reduce(self, func, args, state, listitems, dictitems, obj)
    417
    418         if state is not None:
--> 419             save(state)
    420             write(BUILD)
    421

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    284         f = self.dispatch.get(t)
    285         if f:
--> 286             f(self, obj) # Call unbound method with explicit self
    287             return
    288

/sw/lib/python2.7/pickle.pyc in save_dict(self, obj)
    647
    648         self.memoize(obj)
--> 649         self._batch_setitems(obj.iteritems())
    650
    651     dispatch[DictionaryType] = save_dict

/sw/lib/python2.7/pickle.pyc in _batch_setitems(self, items)
    661             for k, v in items:
    662                 save(k)
--> 663                 save(v)
    664                 write(SETITEM)
    665             return

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    284         f = self.dispatch.get(t)
    285         if f:
--> 286             f(self, obj) # Call unbound method with explicit self
    287             return
    288

/sw/lib/python2.7/pickle.pyc in save_tuple(self, obj)
    560         write(MARK)
    561         for element in obj:
--> 562             save(element)
    563
    564         if id(obj) in memo:

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    284         f = self.dispatch.get(t)
    285         if f:
--> 286             f(self, obj) # Call unbound method with explicit self
    287             return
    288

/sw/lib/python2.7/pickle.pyc in save_tuple(self, obj)
    560         write(MARK)
    561         for element in obj:
--> 562             save(element)
    563
    564         if id(obj) in memo:

/sw/lib/python2.7/pickle.pyc in save(self, obj)
    284         f = self.dispatch.get(t)
    285         if f:
--> 286             f(self, obj) # Call unbound method with explicit self
    287             return
    288

/sw/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 <function <lambda> at 0x10cc018c0>: it's not found as sympy.polys.agca.modules.<lambda>

This makes it impossible to use these objects in SymPy Live.

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"sympy-issues" 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/sympy-issues?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to