references and buffer()

km srikrishnamohan at
Sun Oct 8 21:09:24 CEST 2006

Hi all,

in the CPython implementation, it's the address where the object is
> stored.  but that's an implementation detail.

 ok so can i point a vairiable to an address location just as done in C
language ?
>>> y = 'ATGCATGC'
>>> x = buffer(y)
>>> del(y)
>>> x
<read-only buffer for 0xbf4cf0e0, size -1, offset 0 at 0xbf4cf240>
>>> print x

now even when i delete y,  why is that x still exists ?
thats true even in the case of vairable assignment which states it a a
reference !
>>> a = 10
>>> b = a
>>> del(a)
>>> b
i always thought if u modify the referred variable/buffer object it should
be reflected in the referenced variables/buffers objects . am i wrong ?
does it mean that references  in python are not true references ?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list