On Sun, 26 Jun 2005 23:22:00 -0500, Terry Hancock wrote:

>> You need to differentiate
>>    a = b = 1
>> from
>>    a = b == 1
> 
> Okay, I see what you mean.  I can't ever recall having needed the
> second form, though.
> 
> Of course, you could still do assignment like this:
> 
> a, b = (1,)*2
> 
> But I guess that's not exactly elegant. ;-)

In general that is not the same thing as a = b = obj.

py> a, b = ([], [])
py> a.append(1)
py> b
[]
py> a = b = []
py> a.append(1)
py> b
[1]


-- 
Steven.

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to