cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Victor Kryukov
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Nick Vatamaniuc
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Daniel Nogradi
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))

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Nick Vatamaniuc
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Chris Mellon
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Marc 'BlackJack' Rintsch
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Daniel Nogradi
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Josiah Carlson
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

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Gabriel Genellina
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