Hello list,
I've found the following strange behavior of cPickle. Do you think
it's a bug, or is it by design?
Best regards,
Victor.
from pickle import dumps
from cPickle import dumps as cdumps
print dumps('1001799')==dumps(str(1001799))
print cdumps('1001799')==cdumps(str(1001799))
outputs
On May 16, 1:13 pm, Victor Kryukov [EMAIL PROTECTED] wrote:
Hello list,
I've found the following strange behavior of cPickle. Do you think
it's a bug, or is it by design?
Best regards,
Victor.
from pickle import dumps
from cPickle import dumps as cdumps
print
I've found the following strange behavior of cPickle. Do you think
it's a bug, or is it by design?
Best regards,
Victor.
from pickle import dumps
from cPickle import dumps as cdumps
print dumps('1001799')==dumps(str(1001799))
print cdumps('1001799')==cdumps(str(1001799))
On May 16, 1:13 pm, Victor Kryukov [EMAIL PROTECTED] wrote:
Hello list,
I've found the following strange behavior of cPickle. Do you think
it's a bug, or is it by design?
Best regards,
Victor.
from pickle import dumps
from cPickle import dumps as cdumps
print
On 5/16/07, Daniel Nogradi [EMAIL PROTECTED] wrote:
I've found the following strange behavior of cPickle. Do you think
it's a bug, or is it by design?
Best regards,
Victor.
from pickle import dumps
from cPickle import dumps as cdumps
print
In [EMAIL PROTECTED], Daniel Nogradi
wrote:
The OP was not comparing identity but equality. So it looks like a
real bug, I think the following should be True for any function f:
if a == b: f(a) == f(b)
or not?
In [74]: def f(x):
: return x / 2
:
In [75]: a = 5
In
I've found the following strange behavior of cPickle. Do you think
it's a bug, or is it by design?
Best regards,
Victor.
from pickle import dumps
from cPickle import dumps as cdumps
print dumps('1001799')==dumps(str(1001799))
print
Daniel Nogradi wrote:
Caching?
from cPickle import dumps
dumps('0') == dumps(str(0))
True
dumps('1') == dumps(str(1))
True
dumps('2') == dumps(str(2))
True
dumps('9') == dumps(str(9))
True
dumps('10') == dumps(str(10))
False
dumps('11') == dumps(str(11))
False
En Thu, 17 May 2007 02:09:02 -0300, Josiah Carlson
[EMAIL PROTECTED] escribió:
All strings of length 0 (there is 1) and 1 (there are 256) are interned.
I thought it was the case too, but not always:
py a = a
py b = A.lower()
py a==b
True
py a is b
False
py a is intern(a)
True
py b is