#5985: [with patch, needs review] cPickle: adds support for class pickling
customization
---------------------+------------------------------------------------------
Reporter: nthiery | Owner: nthiery
Type: defect | Status: assigned
Priority: major | Milestone: sage-4.1.1
Component: misc | Keywords: cPickle, pickling classes
Reviewer: | Author:
Merged: |
---------------------+------------------------------------------------------
Comment(by nthiery):
Replying to [comment:15 nthiery]:
> Oops, this testsuite used type.__new__(...) which apparently does not
work anymore with Python 2.6. I just rewrote the testsuite so that it does
not use this feature anymore. See attached patch.
For the record:
zephyr-/opt/sage-4.0.2>./sage
----------------------------------------------------------------------
| Sage Version 4.0.2, Release Date: 2009-06-18 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Loading Sage library. Current Mercurial branch is: combinat
sage: class metaclass(type):
....: def __new__(cls):
....: return type.__new__(cls, "bla", (object,), dict())
....:
sage: metaclass()
<class '__main__.bla'>
zephyr-~>sage
----------------------------------------------------------------------
| Sage Version 4.1, Release Date: 2009-07-09 |
| Type notebook() for the GUI, and license() for information. |
----------------------------------------------------------------------
Loading Sage library. Current Mercurial branch is: combinat
sage: class metaclass(type):
....: def __new__(cls):
....: return type.__new__(cls, "bla", (object,), dict())
....:
sage: metaclass()
------------------------------------------------------------
Traceback (most recent call last):
File "<ipython console>", line 1, in <module>
TypeError: type.__init__() takes 1 or 3 arguments
Apparently type.__new__ now calls type.__init__. And I assume that can
only be a change in python, not in Sage.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5985#comment:16>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---