Re: List sequential initialization

2007-06-18 Thread Steve Holden
Chris Mellon wrote: > On 6/12/07, HMS Surprise <[EMAIL PROTECTED]> wrote: >> Thanks for the explaination. It didn't seem natural and from the >> tutorial I read: >> >> A value can be assigned to several variables simultaneously: >> >> >>> x = y = z = 0 # Zero x, y and z >> >> >> Maybe I in

Re: List sequential initialization

2007-06-13 Thread Dave Baum
In article <[EMAIL PROTECTED]>, HMS Surprise <[EMAIL PROTECTED]> wrote: > I thought if I could do this: > >>> a = b = '' a and b refer to the same object (the empty string) > >>> a = 'a' You are assigning a new value to a - it now refers to the string 'a', while b refers to the same thing it

Re: List sequential initialization

2007-06-12 Thread Chris Mellon
On 6/12/07, HMS Surprise <[EMAIL PROTECTED]> wrote: > Thanks for the explaination. It didn't seem natural and from the > tutorial I read: > > A value can be assigned to several variables simultaneously: > > >>> x = y = z = 0 # Zero x, y and z > > > Maybe I infer too much > And yet, yo

Re: List sequential initialization

2007-06-12 Thread HMS Surprise
Thanks for the explaination. It didn't seem natural and from the tutorial I read: A value can be assigned to several variables simultaneously: >>> x = y = z = 0 # Zero x, y and z Maybe I infer too much thanks again, jh -- http://mail.python.org/mailman/listinfo/python-list

Re: List sequential initialization

2007-06-12 Thread René Fleschenberg
HMS Surprise schrieb: > I thought if I could do this: > >>> a = b = '' Bind both the names a and b to the same string object. > >>> a = 'a' Bind the name a to a *new* string object with the value 'a'. This replaces the previous binding of the name a. > >>> la = lb = [] Bind both the names la a