[IPython-user] Embedded IPython and -pylab
Ville M. Vainio
vivainio@gmail....
Mon Sep 15 05:04:55 CDT 2008
On Mon, Sep 15, 2008 at 11:56 AM, Inigo Aldazabal Mensa
<inigo_aldazabal@ehu.es> wrote:
> mmm... while writting this I checked a bit more and it seems to be related
> on how python itself treats variable aliasing.
>
>>>> a=1
>>>> b=a
>>>> b is a
> True
>>>> b=2
>>>> b is a
> False
>>>> a
> 1
>>>>
>
> I think I understand what happens, but I'll have to think about it a bit
> more.
Yes, you will see that if you edit *mutable* data types (e.g. append
no list), you will see the same value on both sides.
--
Ville M. Vainio
http://tinyurl.com/vainio
More information about the IPython-user
mailing list