Newbie References Question
aleax at aleax.it
Wed Sep 25 16:54:24 CEST 2002
Guy Rabiller wrote:
> let say I have:
> i1 = 1
> Textualy, how if I want that p refere to the 'i1' container, and not to
There is no 'i1' CONTAINER. 'i1' is just a NAME. That's what variables
are in Python -- they don't contain anything: they're like post-it labels,
attached to an object or to another.
> the refererence it contains ?
> What I want is that if now I set:
> i1 = 4
> that automaticaly:
> p -> [4,2]
> and not keeping [1,2]
There is no way to do exactly what you require. There may be ways to
do roughly-equivalent things, if you help us help you by explaining
your application context a bit more widely.
More information about the Python-list