Suggestions for 2002
Paul Rubin
phr-n2002a at nightsong.com
Sat Jan 12 23:43:38 EST 2002
"Mark McEahern" <marklists at mceahern.com> writes:
> What would you expect here (breaking the multiple assignment up into
> separate assignment)?
>
> >>> a = ['cat','dog']
> >>> i = 1
> >>> i = 0
> >>> a[i] = 'boo'
> >>> a
>
> Clearly, you'd expect ['boo', 'dog'].
>
> So where's the problem?
I'd expect a,b = c,d to work as something like:
temp1 = c
temp2 = d
a = temp1
b = temp2
More information about the Python-list
mailing list