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>
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
du
> > > > 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(100
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
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
> > >
> > > pri
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 dumps('100179
> > 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')==cdum
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 dumps('100179
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
T