Newbie References Question

sismex01 at hebmex.com sismex01 at hebmex.com
Wed Sep 25 10:31:43 EDT 2002


> 
> Hi,
> 
> let say I have:
> i1 = 1
> i2 = 2
> and
> p = [i1,i2]
> 
> How can I have:
> p=[*i1,*i2]
> rather than
> p=[**i1,**i2] as it is curently ?
> 
> ( Sorry for this nasty hybrid syntax )
> 
> Textualy, how if I want that p[0] refere to the 'i1' 
> container, and not to
> 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]
> 
> Thanks in advance.
> 
> --
> guy rabiller
> 3d animator / td
> grabiller at 3dvf.net
> http://grabiller.3dvf.net
> 

Repeat after me: "there is no spoon"

Really though; you're chasing a ghost; the "container" you're
looking for is (in the case of CPython) an element in a dictionary,
any definition in a namespace is a definition in the
dictionary which implements said namespace.

Also, when you do a "i1 = 4", you're actually deleting the
previous binding for the name "i1", and rebinding it to
the object "int(4)".

Why not tell us what you're trying to do, and maybe someone
can come with a scheme to let you do it. :-)

Good luck!

-gus




Advertencia: 
La informacion contenida en este mensaje es confidencial y restringida y
esta destinada unicamente para el uso de la persona arriba indicada, Esta
comunicacion representa la opinion personal del remitente y no refleja
necesariamente la opinion de la Compañia. Se le notifica que esta
estrictamente prohibida cualquier difusion, distribucion o copia de este
mensaje. Si ha recibido esta comunicacion o copia de este mensaje por error,
o si hay problemas en la transmision, favor de comunicarse con el remitente.


Todo el correo electrónico enviado para o desde esta dirección será
procesado por el sistema de correo corporativo de HEB. Tal correo
electrónico esta sujeto a ser almacenado y puede ser revisado por alguien
ajeno al recipiente autorizado con el propósito de monitorear que se cumplan
las normas de seguridad de la empresa.




More information about the Python-list mailing list