Suggestions for 2002

Paul Rubin phr-n2002a at nightsong.com
Sun Jan 13 05:43:38 CET 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