Alexandre Vassalotti alexan...@peadrop.com added the comment:
Do I understand correctly that the issue is that python
Pickler class has dispatch attribute but C Pickler does
not?
Yes.
The add_dispatch_check-0.patch patch does not seem
to add class attribute, it adds an instance attribute
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Do I understand correctly that the issue is that python Pickler class has
dispatch attribute but C Pickler does not? The add_dispatch_check-0.patch
patch does not seem to add class attribute, it adds an instance
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Maybe I missed something, but the (subclassable) python implementation
of Pickler is still available with another name:
from pickle import _Pickler as Pickler
class ForkingPickler(Pickler):
dispatch = Pickler.dispatch.copy()
Alexandre Vassalotti [EMAIL PROTECTED] added the comment:
I ran into a few problems while trying to fix this issue. First, does
someone know how to add class attributes on extension types? It sounds
like I will need either some tp_dict hacking or a Pickler subclass.
Second, which methods of
Alexandre Vassalotti [EMAIL PROTECTED] added the comment:
I got a preliminary patch that adds the dispatch dictionary. However,
the patch leaks and it doesn't expose the save_reduce() method (which is
needed by ForkingPickler).
--
keywords: +patch
Added file:
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
A use case:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/572213
shows how code can use the Pickler.dispatch dict, but also some
Pickler.save_xxx function which should be exposed as well.
___
Alexandre Vassalotti [EMAIL PROTECTED] added the comment:
Just in case you are wondering why I haven't submitted a patch yet, I
want to let you know that my home computer is currently broken. So, I
won't be able to work on this until I get my computer fixed (which
unfortunately could take a
Changes by Amaury Forgeot d'Arc [EMAIL PROTECTED]:
--
nosy: +amaury.forgeotdarc
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3385
___
___
New submission from Jesse Noller [EMAIL PROTECTED]:
I was attempting the patch for issue3125 to py3k, and in it Amaury
defines a new ForkingPickler:
from pickle import Pickler
class ForkingPickler(Pickler):
dispatch = Pickler.dispatch.copy()
This is also related to issue3350 I suspect.
Alexandre Vassalotti [EMAIL PROTECTED] added the comment:
The omission of the dispatch dictionary was sort of intentional. But
now, I think it would be a good idea to add it to _pickle.Pickler. I
will write a patch ASAP.
___
Python tracker [EMAIL PROTECTED]
10 matches
Mail list logo