Author rb
Recipients rb
Date 2009-03-19.15:53:48
SpamBayes Score 3.06848e-10
Marked as misclassified No
Message-id <>
The documentation states that the output of pickle and cPickle may be
different. However it is implied that the output of a particular module
will always be consistent within itself. This expectation fails for the
case below.

I am using the output of cPickle in order to generate a key to use for
external storage where the key is abstracted to a generic Python
(immutable) object. Without consistency this breaks for me; pickle is
too slow so I need to use cPickle.

$ python
Python 2.5.2 (r252:60911, Oct  5 2008, 19:29:17) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cPickle
>>> key = (1, u'foo')
>>> cPickle.dumps(key)
>>> cPickle.dumps((1, u'foo'))

PythonWin 2.6.1 (r261:67517, Dec  4 2008, 16:51:00) [MSC v.1500 32 bit
on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin' for 
further copyright information.
>>> import cPickle
>>> key = (1,u'foo')
>>> cPickle.dumps(key)
>>> cPickle.dumps((1,u'foo'))

Expected results: the output of the two dumps calls should be the same.
Date User Action Args
2009-03-19 15:53:52rbsetrecipients: + rb
2009-03-19 15:53:52rbsetmessageid: <>
2009-03-19 15:53:50rblinkissue5518 messages
2009-03-19 15:53:48rbcreate