En Wed, 25 Jul 2007 17:32:46 -0300, Conrado PLG [EMAIL PROTECTED]
escribió:
Say you have this structure:
pna/
__init__.py
model.py
__init__.py is empty.
model.py is:
import cPickle as pickle
class A(object):
pass
def serialize():
pickle.dump(A(),
Victor Kryukov [EMAIL PROTECTED] wrote:
The following behavior is completely unexpected. Is it a bug or a by-
design feature?
from pickle import dumps
from cPickle import dumps as cdumps
print dumps('1001799')==dumps(str(1001799))
print cdumps('1001799')==cdumps(str(1001799))
Victor Kryukov wrote:
The following behavior is completely unexpected. Is it a bug or a by-
design feature?
...
from pickle import dumps
from cPickle import dumps as cdumps
print dumps('1001799')==dumps(str(1001799))
print cdumps('1001799')==cdumps(str(1001799))
It's a feature, the
This does seem odd, at the very least.
The differences between the pn codes comes from this comment in cPickle.c:
/* Make sure memo keys are positive! */
/* XXX Why?
* XXX And does positive really mean non-negative?
* XXX pickle.py starts with PUT index 0, not
Hello list,
The following behavior is completely unexpected. Is it a bug or a by-
design feature?
Regards,
Victor.
-
from pickle import dumps
from cPickle import dumps as cdumps
print dumps('1001799')==dumps(str(1001799))
print cdumps('1001799')==cdumps(str(1001799))
output:
On 16 May 2007 10:06:20 -0700, Victor Kryukov [EMAIL PROTECTED] wrote:
Hello list,
The following behavior is completely unexpected. Is it a bug or a by-
design feature?
Regards,
Victor.
-
from pickle import dumps
from cPickle import dumps as cdumps
print
ActivePython 2.5.1.1 as well:
PythonWin 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit
(Intel)] on win32.
Portions Copyright 1994-2006 Mark Hammond - see 'Help/About PythonWin'
for further copyright information.
from pickle import dumps
from cPickle import dumps as cdumps
print
Hey everyone, cPickle is raising an ImportError that I just don't quite
understand. Before I paste the code, let me explain the application.
Basically the part of the application that failed is a function that
loads a list of objects from a file using cPickle. This list is a queue
of
Carl J. Van Arsdall wrote:
Hey everyone, cPickle is raising an ImportError that I just don't quite
understand. Before I paste the code, let me explain the application.
Basically the part of the application that failed is a function that
loads a list of objects from a file using
[Carl J. Van Arsdall]
Hey everyone, cPickle is raising an ImportError that I just don't quite
understand.
When that happens, the overwhelmingly most likely cause is that the
set of modules on your PYTHONPATH has changed since the pickle was
first created, in ways such that a module _referenced_
10 matches
Mail list logo