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. However, using the 
pickle.Pickler module under py3k, there is no dispatch() method on the 
class:

Trunk:
Python 2.6b1+ (trunk:65015M, Jul 16 2008, 10:15:51) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> dir(pickle.Pickler)
['_BATCHSIZE', '__doc__', '__init__', '__module__', '_batch_appends', 
'_batch_setitems', 'clear_memo', 'dispatch', 'dump', 'get', 'memoize', 
'persistent_id', 'put', 'save', 'save_bool', 'save_dict', 
'save_empty_tuple', 'save_float', 'save_global', 'save_inst', 
'save_int', 'save_list', 'save_long', 'save_none', 'save_pers', 
'save_reduce', 'save_string', 'save_tuple', 'save_unicode']
>>> 

py3k:
Python 3.0b1+ (py3k:65011M, Jul 16 2008, 11:50:11) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pickle
>>> dir(Pickler)
['__class__', '__delattr__', '__doc__', '__eq__', '__format__', 
'__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', 
'__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', 
'__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', 
'bin', 'clear_memo', 'dump', 'fast', 'memo', 'persistent_id']

I think the fix for 3125 resolves your complaint in 3350, but is the 
lack of the dispatch method intentional?

----------
assignee: alexandre.vassalotti
components: Extension Modules
messages: 69816
nosy: alexandre.vassalotti, jnoller
severity: normal
status: open
title: cPickle to pickle conversion in py3k missing methods
versions: Python 3.0

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3385>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to